zenilib: zenilib/jni/external/freetype2/src/smooth/ftgrays.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Macros | Typedefs | Functions
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 )

Definition at line 266 of file ftgrays.c.

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

#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 (*worker)

Definition at line 380 of file ftgrays.c.

Referenced by FT_DEFINE_OUTLINE_FUNCS(), gray_compute_cbox(), gray_convert_glyph(), gray_find_cell(), gray_hline(), gray_init_cells(), gray_raster_render(), gray_record_cell(), gray_render_conic(), gray_render_cubic(), gray_render_line(), gray_render_scanline(), gray_set_cell(), gray_start_cell(), and gray_sweep().

#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

Definition at line 245 of file ftgrays.c.

Referenced by FT_DEFINE_OUTLINE_FUNCS(), gray_convert_glyph(), gray_move_to(), gray_raster_render(), gray_record_cell(), and gray_set_cell().

#define RAS_VAR_ worker,

Definition at line 246 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 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 ) )

Definition at line 268 of file ftgrays.c.

Referenced by gray_move_to(), gray_render_conic(), gray_render_cubic(), gray_render_line(), and gray_render_scanline().

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

Definition at line 1695 of file ftgrays.c.

References error, 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 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_convert_glyph | ( | RAS_ARG |  | ) |

static

Definition at line 1728 of file ftgrays.c.

References error, ErrRaster_Memory_Overflow, FT_TRACE7, gray_compute_cbox(), gray_sweep(), int, max, min, NULL, ras, RAS_VAR, RAS_VAR_, sizeof(), FT_BBox_::xMax, FT_BBox_::xMin, FT_BBox_::yMax, and FT_BBox_::yMin.

Referenced by gray_raster_render().

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

Definition at line 1225 of file ftgrays.c.

References FT_Span_::coverage, FT_INT_MAX, FT_MAX_GRAY_SPANS, FT_OUTLINE_EVEN_ODD_FILL, FT_TRACE7, int, FT_Span_::len, PIXEL_BITS, ras, and FT_Span_::x.

Referenced by gray_sweep().

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

Definition at line 1122 of file ftgrays.c.

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

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 int gray_raster_render | ( | gray_PRaster | raster,
|  | const FT_Raster_Params * | params
| ) |  |

static

Definition at line 1865 of file ftgrays.c.

References FT_Raster_Params_::clip_box, FT_Outline_::contours, ErrRaster_Invalid_Argument, ErrRaster_Invalid_Mode, ErrRaster_Invalid_Outline, FT_Raster_Params_::flags, 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(), FT_Raster_Params_::gray_spans, if(), FT_Outline_::n_contours, FT_Outline_::n_points, FT_Outline_::points, ras, RAS_VAR, RAS_VAR_, FT_Raster_Params_::source, FT_Raster_Params_::target, and FT_Raster_Params_::user.

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

Definition at line 881 of file ftgrays.c.

References FT_ABS, gray_render_line(), gray_split_conic(), max, min, ONE_PIXEL, ras, RAS_VAR_, TRUNC, UPSCALE, FT_Vector_::x, and FT_Vector_::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 983 of file ftgrays.c.

References FT_ABS, gray_render_line(), gray_split_cubic(), max, min, ONE_PIXEL, ras, RAS_VAR_, TRUNC, UPSCALE, FT_Vector_::x, and FT_Vector_::y.

Referenced by gray_cubic_to().

static void gray_render_line | ( | RAS_ARG_ TPos | to_x,
|  | TPos | to_y
| ) |  |

static

Definition at line 704 of file ftgrays.c.

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

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

Definition at line 1174 of file ftgrays.c.

References FT_Bitmap_::buffer, FT_Span_::coverage, FT_MEM_SET, if(), FT_Span_::len, map, FT_Bitmap_::pitch, FT_Bitmap_::rows, and FT_Span_::x.

Referenced by gray_raster_render().

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().