zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftgrays.c File Reference
#include <ft2build.h>
#include "ftgrays.h"
#include <FT_INTERNAL_OBJECTS_H>
#include <FT_INTERNAL_DEBUG_H>
#include <FT_OUTLINE_H>
#include "ftsmerrs.h"
#include "ftspic.h"

Go to the source code of this file.

Macros

#define CEILING(x)   ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )
 
#define DOWNSCALE(x)   ( (x) >> ( PIXEL_BITS - 6 ) )
 
#define ErrRaster_Invalid_Argument   Smooth_Err_Invalid_Argument
 
#define ErrRaster_Invalid_Mode   Smooth_Err_Cannot_Render_Glyph
 
#define ErrRaster_Invalid_Outline   Smooth_Err_Invalid_Outline
 
#define ErrRaster_Memory_Overflow   Smooth_Err_Out_Of_Memory
 
#define FLOOR(x)   ( (x) & -ONE_PIXEL )
 
#define FT_COMPONENT   trace_smooth
 
#define FT_MAX_GRAY_SPANS   32
 
#define FT_MEM_SET(d, s, c)   ft_memset( d, s, c )
 
#define FT_MEM_ZERO(dest, count)   FT_MEM_SET( dest, 0, count )
 
#define ONE_PIXEL   ( 1L << PIXEL_BITS )
 
#define PIXEL_BITS   8
 
#define PIXEL_MASK   ( -1L << PIXEL_BITS )
 
#define ras   (*worker)
 
#define RAS_ARG   gray_PWorker worker
 
#define RAS_ARG_   gray_PWorker worker,
 
#define RAS_VAR   worker
 
#define RAS_VAR_   worker,
 
#define ROUND(x)   ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )
 
#define SUBPIXELS(x)   ( (TPos)(x) << PIXEL_BITS )
 
#define TRUNC(x)   ( (TCoord)( (x) >> PIXEL_BITS ) )
 
#define UPSCALE(x)   ( (x) << ( PIXEL_BITS - 6 ) )
 

Typedefs

typedef struct gray_TRaster_ * gray_PRaster
 
typedef struct gray_TWorker_ * gray_PWorker
 
typedef struct gray_TBand_ gray_TBand
 
typedef struct gray_TRaster_ gray_TRaster
 
typedef struct gray_TWorker_ gray_TWorker
 
typedef struct TCell_ * PCell
 
typedef int TArea
 
typedef struct TCell_ TCell
 
typedef long TCoord
 
typedef long TPos
 

Functions

 FT_DEFINE_OUTLINE_FUNCS (func_interface,(FT_Outline_MoveTo_Func) gray_move_to,(FT_Outline_LineTo_Func) gray_line_to,(FT_Outline_ConicTo_Func) gray_conic_to,(FT_Outline_CubicTo_Func) gray_cubic_to, 0, 0) static int gray_convert_glyph_inner(RAS_ARG)
 
static void gray_compute_cbox (RAS_ARG)
 
static int gray_conic_to (const FT_Vector *control, const FT_Vector *to, gray_PWorker worker)
 
static int gray_convert_glyph (RAS_ARG)
 
static int gray_cubic_to (const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, gray_PWorker worker)
 
static PCell gray_find_cell (RAS_ARG)
 
static void gray_hline (RAS_ARG_ TCoord x, TCoord y, TPos area, TCoord acount)
 
static void gray_init_cells (RAS_ARG_ void *buffer, long byte_size)
 
static int gray_line_to (const FT_Vector *to, gray_PWorker worker)
 
static int gray_move_to (const FT_Vector *to, gray_PWorker worker)
 
static void gray_raster_done (FT_Raster raster)
 
static int gray_raster_new (FT_Memory memory, FT_Raster *araster)
 
static int gray_raster_render (gray_PRaster raster, const FT_Raster_Params *params)
 
static void gray_raster_reset (FT_Raster raster, char *pool_base, long pool_size)
 
static void gray_record_cell (RAS_ARG)
 
static void gray_render_conic (RAS_ARG_ const FT_Vector *control, const FT_Vector *to)
 
static void gray_render_cubic (RAS_ARG_ const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to)
 
static void gray_render_line (RAS_ARG_ TPos to_x, TPos to_y)
 
static void gray_render_scanline (RAS_ARG_ TCoord ey, TPos x1, TCoord y1, TPos x2, TCoord y2)
 
static void gray_render_span (int y, int count, const FT_Span *spans, gray_PWorker worker)
 
static void gray_set_cell (RAS_ARG_ TCoord ex, TCoord ey)
 
static void gray_split_conic (FT_Vector *base)
 
static void gray_split_cubic (FT_Vector *base)
 
static void gray_start_cell (RAS_ARG_ TCoord ex, TCoord ey)
 
static void gray_sweep (RAS_ARG_ const FT_Bitmap *target)
 

Macro Definition Documentation

#define CEILING (   x)    ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )

Definition at line 271 of file ftgrays.c.

#define DOWNSCALE (   x)    ( (x) >> ( PIXEL_BITS - 6 ) )

Definition at line 276 of file ftgrays.c.

#define ErrRaster_Invalid_Argument   Smooth_Err_Invalid_Argument

Definition at line 221 of file ftgrays.c.

Referenced by gray_raster_render().

#define ErrRaster_Invalid_Mode   Smooth_Err_Cannot_Render_Glyph

Definition at line 218 of file ftgrays.c.

Referenced by gray_raster_render().

#define ErrRaster_Invalid_Outline   Smooth_Err_Invalid_Outline

Definition at line 219 of file ftgrays.c.

Referenced by gray_raster_render().

#define ErrRaster_Memory_Overflow   Smooth_Err_Out_Of_Memory

Definition at line 220 of file ftgrays.c.

Referenced by FT_DEFINE_OUTLINE_FUNCS(), and gray_convert_glyph().

#define FLOOR (   x)    ( (x) & -ONE_PIXEL )

Definition at line 270 of file ftgrays.c.

#define FT_COMPONENT   trace_smooth

Definition at line 91 of file ftgrays.c.

#define FT_MAX_GRAY_SPANS   32

Definition at line 316 of file ftgrays.c.

Referenced by gray_hline().

#define FT_MEM_SET (   d,
  s,
  c 
)    ft_memset( d, s, c )

Definition at line 226 of file ftgrays.c.

Referenced by gray_render_span().

#define FT_MEM_ZERO (   dest,
  count 
)    FT_MEM_SET( dest, 0, count )

Definition at line 230 of file ftgrays.c.

#define ONE_PIXEL   ( 1L << PIXEL_BITS )
#define PIXEL_BITS   8

Definition at line 259 of file ftgrays.c.

Referenced by gray_hline().

#define PIXEL_MASK   ( -1L << PIXEL_BITS )

Definition at line 267 of file ftgrays.c.

#define RAS_ARG   gray_PWorker worker

Definition at line 242 of file ftgrays.c.

#define RAS_ARG_   gray_PWorker worker,

Definition at line 243 of file ftgrays.c.

#define RAS_VAR   worker
#define ROUND (   x)    ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )

Definition at line 272 of file ftgrays.c.

#define SUBPIXELS (   x)    ( (TPos)(x) << PIXEL_BITS )

Definition at line 269 of file ftgrays.c.

Referenced by gray_render_line(), gray_render_scanline(), and gray_start_cell().

#define TRUNC (   x)    ( (TCoord)( (x) >> PIXEL_BITS ) )
#define UPSCALE (   x)    ( (x) << ( PIXEL_BITS - 6 ) )

Definition at line 275 of file ftgrays.c.

Referenced by gray_line_to(), gray_move_to(), gray_render_conic(), and gray_render_cubic().

Typedef Documentation

typedef struct gray_TRaster_ * gray_PRaster
typedef struct gray_TWorker_ * gray_PWorker
typedef struct gray_TBand_ gray_TBand
typedef struct gray_TRaster_ gray_TRaster
typedef struct gray_TWorker_ gray_TWorker
typedef struct TCell_* PCell

Definition at line 319 of file ftgrays.c.

typedef int TArea

Definition at line 309 of file ftgrays.c.

typedef struct TCell_ TCell
typedef long TCoord

Definition at line 292 of file ftgrays.c.

typedef long TPos

Definition at line 293 of file ftgrays.c.

Function Documentation

FT_DEFINE_OUTLINE_FUNCS ( func_interface  ,
(FT_Outline_MoveTo_Func gray_move_to,
(FT_Outline_LineTo_Func gray_line_to,
(FT_Outline_ConicTo_Func gray_conic_to,
(FT_Outline_CubicTo_Func gray_cubic_to,
,
 
)
static void gray_compute_cbox ( RAS_ARG  )
static

Definition at line 424 of file ftgrays.c.

References FT_Outline_::n_points, FT_Outline_::points, ras, vec, FT_Vector_::x, and FT_Vector_::y.

Referenced by gray_convert_glyph().

static int gray_conic_to ( const FT_Vector control,
const FT_Vector to,
gray_PWorker  worker 
)
static

Definition at line 1153 of file ftgrays.c.

References gray_render_conic(), and RAS_VAR_.

static int gray_cubic_to ( const FT_Vector control1,
const FT_Vector control2,
const FT_Vector to,
gray_PWorker  worker 
)
static

Definition at line 1163 of file ftgrays.c.

References gray_render_cubic(), and RAS_VAR_.

static PCell gray_find_cell ( RAS_ARG  )
static

Definition at line 468 of file ftgrays.c.

References ft_longjmp, NULL, and ras.

Referenced by gray_record_cell().

static void gray_hline ( RAS_ARG_ TCoord  x,
TCoord  y,
TPos  area,
TCoord  acount 
)
static
static void gray_init_cells ( RAS_ARG_ void buffer,
long  byte_size 
)
static

Definition at line 403 of file ftgrays.c.

References NULL, and ras.

Referenced by gray_raster_render().

static int gray_line_to ( const FT_Vector to,
gray_PWorker  worker 
)
static

Definition at line 1144 of file ftgrays.c.

References gray_render_line(), RAS_VAR_, UPSCALE, FT_Vector_::x, and FT_Vector_::y.

static int gray_move_to ( const FT_Vector to,
gray_PWorker  worker 
)
static
static void gray_raster_done ( FT_Raster  raster)
static

Definition at line 2003 of file ftgrays.c.

References FT_FREE.

static int gray_raster_new ( FT_Memory  memory,
FT_Raster araster 
)
static

Definition at line 1984 of file ftgrays.c.

References error, FT_ALLOC, and NULL.

static void gray_raster_reset ( FT_Raster  raster,
char *  pool_base,
long  pool_size 
)
static

Definition at line 2015 of file ftgrays.c.

References int, NULL, and sizeof().

static void gray_record_cell ( RAS_ARG  )
static

Definition at line 507 of file ftgrays.c.

References gray_find_cell(), ras, and RAS_VAR.

Referenced by FT_DEFINE_OUTLINE_FUNCS(), gray_move_to(), and gray_set_cell().

static void gray_render_conic ( RAS_ARG_ const FT_Vector control,
const FT_Vector to 
)
static
static void gray_render_cubic ( RAS_ARG_ const FT_Vector control1,
const FT_Vector control2,
const FT_Vector to 
)
static
static void gray_render_line ( RAS_ARG_ TPos  to_x,
TPos  to_y 
)
static
static void gray_render_scanline ( RAS_ARG_ TCoord  ey,
TPos  x1,
TCoord  y1,
TPos  x2,
TCoord  y2 
)
static

Definition at line 597 of file ftgrays.c.

References gray_set_cell(), int, ONE_PIXEL, ras, RAS_VAR_, SUBPIXELS, and TRUNC.

Referenced by gray_render_line().

static void gray_render_span ( int  y,
int  count,
const FT_Span spans,
gray_PWorker  worker 
)
static
static void gray_set_cell ( RAS_ARG_ TCoord  ex,
TCoord  ey 
)
static

Definition at line 525 of file ftgrays.c.

References gray_record_cell(), ras, and RAS_VAR.

Referenced by gray_render_line(), gray_render_scanline(), and gray_start_cell().

static void gray_split_conic ( FT_Vector base)
static

Definition at line 861 of file ftgrays.c.

References FT_Vector_::x, and FT_Vector_::y.

Referenced by gray_render_conic().

static void gray_split_cubic ( FT_Vector base)
static

Definition at line 955 of file ftgrays.c.

References d, FT_Vector_::x, and FT_Vector_::y.

Referenced by gray_render_cubic().

static void gray_start_cell ( RAS_ARG_ TCoord  ex,
TCoord  ey 
)
static

Definition at line 572 of file ftgrays.c.

References gray_set_cell(), ras, RAS_VAR_, and SUBPIXELS.

Referenced by gray_move_to().

static void gray_sweep ( RAS_ARG_ const FT_Bitmap target)
static

Definition at line 1355 of file ftgrays.c.

References FT_TRACE7, FT_UNUSED, gray_hline(), if(), NULL, ONE_PIXEL, ras, and RAS_VAR_.

Referenced by gray_convert_glyph().