ftgrays.c File Reference

#include <ft2build.h>
#include "ftgrays.h"
#include "ftsmerrs.h"
#include "ftspic.h"

Go to the source code of this file.

Classes

struct  TCell_
struct  TWorker_
struct  TRaster_
struct  TBand_

Defines

#define FT_COMPONENT   trace_smooth
#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 ErrRaster_Invalid_Argument   Smooth_Err_Invalid_Argument
#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 RAS_ARG   PWorker worker
#define RAS_ARG_   PWorker worker,
#define RAS_VAR   worker
#define RAS_VAR_   worker,
#define PIXEL_BITS   8
#define ONE_PIXEL   ( 1L << PIXEL_BITS )
#define PIXEL_MASK   ( -1L << PIXEL_BITS )
#define TRUNC(x)   ( (TCoord)( (x) >> PIXEL_BITS ) )
#define SUBPIXELS(x)   ( (TPos)(x) << PIXEL_BITS )
#define FLOOR(x)   ( (x) & -ONE_PIXEL )
#define CEILING(x)   ( ( (x) + ONE_PIXEL - 1 ) & -ONE_PIXEL )
#define ROUND(x)   ( ( (x) + ONE_PIXEL / 2 ) & -ONE_PIXEL )
#define UPSCALE(x)   ( (x) << ( PIXEL_BITS - 6 ) )
#define DOWNSCALE(x)   ( (x) >> ( PIXEL_BITS - 6 ) )
#define FT_MAX_GRAY_SPANS   32
#define ras   (*worker)

Typedefs

typedef long TCoord
typedef long TPos
typedef int TArea
typedef TCell_PCell
typedef TCell_ TCell
typedef TWorker_ TWorker
typedef TWorker_PWorker
typedef TRaster_ TRaster
typedef TRaster_PRaster
typedef TBand_ TBand

Functions

static void gray_init_cells (RAS_ARG_ void *buffer, long byte_size)
static void gray_compute_cbox (RAS_ARG)
static PCell gray_find_cell (RAS_ARG)
static void gray_record_cell (RAS_ARG)
static void gray_set_cell (RAS_ARG_ TCoord ex, TCoord ey)
static void gray_start_cell (RAS_ARG_ TCoord ex, TCoord ey)
static void gray_render_scanline (RAS_ARG_ TCoord ey, TPos x1, TCoord y1, TPos x2, TCoord y2)
static void gray_render_line (RAS_ARG_ TPos to_x, TPos to_y)
static void gray_split_conic (FT_Vector *base)
static void gray_render_conic (RAS_ARG_ const FT_Vector *control, const FT_Vector *to)
static void gray_split_cubic (FT_Vector *base)
static void gray_render_cubic (RAS_ARG_ const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to)
static int gray_move_to (const FT_Vector *to, PWorker worker)
static int gray_line_to (const FT_Vector *to, PWorker worker)
static int gray_conic_to (const FT_Vector *control, const FT_Vector *to, PWorker worker)
static int gray_cubic_to (const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, PWorker worker)
static void gray_render_span (int y, int count, const FT_Span *spans, PWorker worker)
static void gray_hline (RAS_ARG_ TCoord x, TCoord y, TPos area, TCoord acount)
static void gray_sweep (RAS_ARG_ const FT_Bitmap *target)
 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 int gray_convert_glyph (RAS_ARG)
static int gray_raster_render (PRaster raster, const FT_Raster_Params *params)
static int gray_raster_new (FT_Memory memory, FT_Raster *araster)
static void gray_raster_done (FT_Raster raster)
static void gray_raster_reset (FT_Raster raster, char *pool_base, long pool_size)


Define Documentation

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

Definition at line 257 of file ftgrays.c.

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

Definition at line 262 of file ftgrays.c.

Referenced by gray_render_conic(), and gray_render_cubic().

#define ErrRaster_Invalid_Argument   Smooth_Err_Invalid_Argument

Definition at line 217 of file ftgrays.c.

Referenced by gray_raster_render().

#define ErrRaster_Invalid_Mode   Smooth_Err_Cannot_Render_Glyph

Definition at line 214 of file ftgrays.c.

Referenced by gray_raster_render().

#define ErrRaster_Invalid_Outline   Smooth_Err_Invalid_Outline

Definition at line 215 of file ftgrays.c.

Referenced by gray_raster_render().

#define ErrRaster_Memory_Overflow   Smooth_Err_Out_Of_Memory

Definition at line 216 of file ftgrays.c.

Referenced by FT_DEFINE_OUTLINE_FUNCS(), and gray_convert_glyph().

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

Definition at line 256 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 302 of file ftgrays.c.

Referenced by gray_hline().

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

Definition at line 222 of file ftgrays.c.

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

Definition at line 226 of file ftgrays.c.

#define ONE_PIXEL   ( 1L << PIXEL_BITS )

Definition at line 252 of file ftgrays.c.

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

#define PIXEL_BITS   8

Definition at line 250 of file ftgrays.c.

Referenced by gray_hline().

#define PIXEL_MASK   ( -1L << PIXEL_BITS )

Definition at line 253 of file ftgrays.c.

#define ras   (*worker)

Definition at line 368 of file ftgrays.c.

#define RAS_ARG   PWorker worker

Definition at line 233 of file ftgrays.c.

#define RAS_ARG_   PWorker worker,

Definition at line 234 of file ftgrays.c.

#define RAS_VAR   worker

Definition at line 236 of file ftgrays.c.

#define RAS_VAR_   worker,

Definition at line 237 of file ftgrays.c.

Referenced by gray_conic_to(), gray_convert_glyph(), gray_cubic_to(), gray_line_to(), gray_move_to(), gray_raster_render(), gray_render_conic(), gray_render_cubic(), gray_render_line(), gray_render_scanline(), gray_start_cell(), and gray_sweep().

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

Definition at line 258 of file ftgrays.c.

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

Definition at line 255 of file ftgrays.c.

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

#define TRUNC ( x   )     ( (TCoord)( (x) >> PIXEL_BITS ) )

Definition at line 254 of file ftgrays.c.

#define UPSCALE ( x   )     ( (x) << ( PIXEL_BITS - 6 ) )

Definition at line 261 of file ftgrays.c.

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


Typedef Documentation

typedef struct TCell_* PCell

Definition at line 305 of file ftgrays.c.

typedef struct TRaster_ * PRaster

typedef struct TWorker_ * PWorker

typedef int TArea

Definition at line 295 of file ftgrays.c.

typedef struct TBand_ TBand

typedef struct TCell_ TCell

typedef long TCoord

Definition at line 278 of file ftgrays.c.

typedef long TPos

Definition at line 279 of file ftgrays.c.

typedef struct TRaster_ TRaster

typedef struct TWorker_ TWorker


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,
,
 
)

Definition at line 1701 of file ftgrays.c.

References ErrRaster_Memory_Overflow, FT_Outline_Decompose(), ft_setjmp, gray_record_cell(), ras, and RAS_VAR.

static void gray_compute_cbox ( RAS_ARG   )  [static]

Definition at line 412 of file ftgrays.c.

References if(), FT_Outline_::n_points, FT_Outline_::points, ras, FT_Vector_::x, x, FT_Vector_::y, and y.

Referenced by gray_convert_glyph().

static int gray_conic_to ( const FT_Vector control,
const FT_Vector to,
PWorker  worker 
) [static]

Definition at line 1159 of file ftgrays.c.

References gray_render_conic(), and RAS_VAR_.

static int gray_convert_glyph ( RAS_ARG   )  [static]

Definition at line 1734 of file ftgrays.c.

References clip(), ErrRaster_Memory_Overflow, for(), FT_TRACE7, gray_compute_cbox(), gray_sweep(), if(), int, level, max, TBand_::max, TBand_::min, min, NULL, ras, RAS_VAR, RAS_VAR_, sizeof(), and top().

Referenced by gray_raster_render().

static int gray_cubic_to ( const FT_Vector control1,
const FT_Vector control2,
const FT_Vector to,
PWorker  worker 
) [static]

Definition at line 1169 of file ftgrays.c.

References gray_render_cubic(), and RAS_VAR_.

static PCell gray_find_cell ( RAS_ARG   )  [static]

Definition at line 456 of file ftgrays.c.

References TCell_::area, TCell_::cover, ft_longjmp, if(), TCell_::next, NULL, ras, TCell_::x, and x.

Referenced by gray_record_cell().

static void gray_hline ( RAS_ARG_ TCoord  x,
TCoord  y,
TPos  area,
TCoord  acount 
) [static]

Definition at line 1231 of file ftgrays.c.

References FT_INT_MAX, FT_MAX_GRAY_SPANS, FT_OUTLINE_EVEN_ODD_FILL, FT_TRACE7, int, n, PIXEL_BITS, ras, and short.

Referenced by gray_sweep().

static void gray_init_cells ( RAS_ARG_ void *  buffer,
long  byte_size 
) [static]

Definition at line 391 of file ftgrays.c.

References NULL, and ras.

Referenced by gray_raster_render().

static int gray_line_to ( const FT_Vector to,
PWorker  worker 
) [static]

Definition at line 1150 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,
PWorker  worker 
) [static]

Definition at line 1128 of file ftgrays.c.

References gray_record_cell(), gray_start_cell(), RAS_VAR, RAS_VAR_, TRUNC, UPSCALE, FT_Vector_::x, TWorker_::x, x, FT_Vector_::y, TWorker_::y, and y.

static void gray_raster_done ( FT_Raster  raster  )  [static]

Definition at line 2028 of file ftgrays.c.

References FT_FREE.

static int gray_raster_new ( FT_Memory  memory,
FT_Raster araster 
) [static]

Definition at line 2009 of file ftgrays.c.

References FT_ALLOC, and TRaster_::memory.

static int gray_raster_render ( PRaster  raster,
const FT_Raster_Params params 
) [static]

Definition at line 1890 of file ftgrays.c.

References TRaster_::band_size, TRaster_::buffer, TRaster_::buffer_size, FT_Outline_::contours, ErrRaster_Invalid_Argument, ErrRaster_Invalid_Mode, ErrRaster_Invalid_Outline, FT_RASTER_FLAG_AA, FT_RASTER_FLAG_CLIP, FT_RASTER_FLAG_DIRECT, FT_Raster_Span_Func, gray_convert_glyph(), gray_init_cells(), gray_render_span(), if(), RooFitShortHand::L(), FT_Outline_::n_contours, FT_Outline_::n_points, params, FT_Outline_::points, ras, RAS_VAR, RAS_VAR_, and TRaster_::worker.

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

Definition at line 2040 of file ftgrays.c.

References TRaster_::band_size, TRaster_::buffer, TRaster_::buffer_size, int, long, NULL, sizeof(), and TRaster_::worker.

static void gray_record_cell ( RAS_ARG   )  [static]

Definition at line 495 of file ftgrays.c.

References TCell_::area, TCell_::cover, 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]

Definition at line 869 of file ftgrays.c.

References DOWNSCALE, Draw(), gray_render_line(), gray_split_conic(), level, max, min, ras, RAS_VAR_, top(), TRUNC, UPSCALE, FT_Vector_::x, FT_Vector_::y, and y.

Referenced by gray_conic_to().

static void gray_render_cubic ( RAS_ARG_ const FT_Vector control1,
const FT_Vector control2,
const FT_Vector to 
) [static]

Definition at line 1006 of file ftgrays.c.

References DOWNSCALE, Draw(), gray_render_line(), gray_split_cubic(), level, max, min, ras, RAS_VAR_, top(), TRUNC, UPSCALE, FT_Vector_::x, FT_Vector_::y, and y.

Referenced by gray_cubic_to().

static void gray_render_line ( RAS_ARG_ TPos  to_x,
TPos  to_y 
) [static]

Definition at line 692 of file ftgrays.c.

References Rgl::Pad::End(), gray_render_scanline(), gray_set_cell(), int, max, min, ONE_PIXEL, p, ras, RAS_VAR_, SUBPIXELS, TRUNC, x, and x2.

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

static void gray_render_scanline ( RAS_ARG_ TCoord  ey,
TPos  x1,
TCoord  y1,
TPos  x2,
TCoord  y2 
) [static]

Definition at line 585 of file ftgrays.c.

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

Referenced by gray_render_line().

static void gray_render_span ( int  y,
int  count,
const FT_Span spans,
PWorker  worker 
) [static]

Definition at line 1180 of file ftgrays.c.

References FT_Bitmap_::buffer, FT_Span_::coverage, for(), FT_MEM_SET, if(), FT_Span_::len, p, FT_Bitmap_::pitch, FT_Bitmap_::rows, TWorker_::target, and FT_Span_::x.

Referenced by gray_raster_render().

static void gray_set_cell ( RAS_ARG_ TCoord  ex,
TCoord  ey 
) [static]

Definition at line 513 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 849 of file ftgrays.c.

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

Referenced by gray_render_conic().

static void gray_split_cubic ( FT_Vector base  )  [static]

Definition at line 978 of file ftgrays.c.

References a, b, c, 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 560 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 1361 of file ftgrays.c.

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

Referenced by gray_convert_glyph().


Generated on Tue Jul 5 15:58:26 2011 for ROOT_528-00b_version by  doxygen 1.5.1