#include <ft2build.h>
#include "ftgrays.h"
#include "ftsmerrs.h"
#include "ftspic.h"
Go to the source code of this file.
|
#define | FT_COMPONENT trace_smooth |
|
#define | Smooth_Err_Invalid_Mode Smooth_Err_Cannot_Render_Glyph |
|
#define | Smooth_Err_Memory_Overflow Smooth_Err_Out_Of_Memory |
|
#define | ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory |
|
#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 | FT_ZERO(p) FT_MEM_ZERO( p, sizeof ( *(p) ) ) |
|
#define | RAS_ARG gray_PWorker worker |
|
#define | RAS_ARG_ gray_PWorker worker, |
|
#define | RAS_VAR worker |
|
#define | RAS_VAR_ worker, |
|
#define | PIXEL_BITS 8 |
|
#define | ONE_PIXEL ( 1 << PIXEL_BITS ) |
|
#define | TRUNC(x) ( (TCoord)( (x) >> PIXEL_BITS ) ) |
|
#define | SUBPIXELS(x) ( (TPos)(x) * ONE_PIXEL ) |
|
#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) * ( ONE_PIXEL >> 6 ) ) |
|
#define | DOWNSCALE(x) ( (x) >> ( PIXEL_BITS - 6 ) ) |
|
#define | FT_DIV_MOD(type, dividend, divisor, quotient, remainder) |
|
#define | FT_UDIVPREP(c, b) |
|
#define | FT_UDIV(a, b) |
|
#define | FT_MAX_GRAY_POOL ( 2048 / sizeof ( TCell ) ) |
|
#define | ras (*worker) |
|
|
static void | gray_record_cell (RAS_ARG) |
|
static void | gray_set_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, gray_PWorker worker) |
|
static int | gray_line_to (const FT_Vector *to, gray_PWorker worker) |
|
static int | gray_conic_to (const FT_Vector *control, const FT_Vector *to, gray_PWorker worker) |
|
static int | gray_cubic_to (const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, gray_PWorker worker) |
|
static void | gray_hline (RAS_ARG_ TCoord x, TCoord y, TArea coverage, TCoord acount) |
|
static void | gray_sweep (RAS_ARG) |
|
| 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 (FT_Raster 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, unsigned char *pool_base, unsigned long pool_size) |
|
static int | gray_raster_set_mode (FT_Raster raster, unsigned long mode, void *args) |
|
◆ CEILING
◆ DOWNSCALE
◆ ErrRaster_Memory_Overflow
#define ErrRaster_Memory_Overflow Smooth_Err_Out_Of_Memory |
◆ FLOOR
◆ FT_COMPONENT
#define FT_COMPONENT trace_smooth |
◆ FT_DIV_MOD
Value: { \
(quotient)--; \
} \
FT_END_STMNT
double __cdecl remainder(double, double)
GLuint GLuint GLsizei GLenum type
Definition at line 357 of file ftgrays.c.
◆ FT_MAX_GRAY_POOL
◆ FT_MEM_SET
◆ FT_MEM_ZERO
◆ FT_UDIV
Value:( ( (
unsigned long)(
a ) * (
unsigned long)(
b ## _r ) ) >> \
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
Definition at line 393 of file ftgrays.c.
◆ FT_UDIVPREP
Value: : 0
GLboolean GLboolean GLboolean b
Definition at line 390 of file ftgrays.c.
◆ FT_ZERO
◆ ONE_PIXEL
◆ PIXEL_BITS
◆ ras
◆ RAS_ARG
◆ RAS_ARG_
◆ RAS_VAR
◆ RAS_VAR_
◆ ROUND
◆ Smooth_Err_Invalid_Mode
#define Smooth_Err_Invalid_Mode Smooth_Err_Cannot_Render_Glyph |
◆ Smooth_Err_Memory_Overflow
#define Smooth_Err_Memory_Overflow Smooth_Err_Out_Of_Memory |
◆ SUBPIXELS
◆ TRUNC
◆ UPSCALE
◆ gray_PRaster
◆ gray_PWorker
◆ gray_TRaster
◆ gray_TWorker
◆ PCell
◆ TArea
◆ TCell
◆ TCoord
◆ TPixmap
◆ TPos
◆ FT_DEFINE_OUTLINE_FUNCS()
Definition at line 1691 of file ftgrays.c.
1708 volatile int error = 0;
1710 #ifdef FT_CONFIG_OPTION_PIC 1712 Init_Class_func_interface(&func_interface);
1721 FT_TRACE7((
"band [%d..%d]: %d cell%s\n",
1725 ras.num_cells == 1 ?
"" :
"s" ));
1731 FT_TRACE7((
"band [%d..%d]: to be bisected\n",
1732 ras.min_ey,
ras.max_ey ));
#define FT_TRACE7(varformat)
FT_BEGIN_HEADER FT_Outline_Decompose(FT_Outline *outline, const FT_Outline_Funcs *func_interface, void *user)
static void gray_record_cell(RAS_ARG)
◆ gray_conic_to()
Definition at line 1213 of file ftgrays.c.
static void gray_render_conic(RAS_ARG_ const FT_Vector *control, const FT_Vector *to)
◆ gray_convert_glyph()
Definition at line 1740 of file ftgrays.c.
1781 for (
y = yMin;
y < yMax; )
1801 ras.min_ex = band[1];
1802 ras.max_ex = band[0];
1826 FT_TRACE7((
"gray_convert_glyph: rotten glyph\n" ));
1836 }
while ( band >= bands );
GLint GLint GLsizei width
static void gray_sweep(RAS_ARG)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
#define ErrRaster_Memory_Overflow
#define FT_TRACE7(varformat)
GLint GLint GLsizei GLsizei height
#define FT_RENDER_POOL_SIZE
GLint GLint GLint GLint GLint GLint y
#define FT_MEM_ZERO(dest, count)
Referenced by gray_raster_render().
◆ gray_cubic_to()
Definition at line 1223 of file ftgrays.c.
static void gray_render_cubic(RAS_ARG_ const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to)
◆ gray_hline()
Definition at line 1234 of file ftgrays.c.
1242 coverage = -coverage - 1;
1249 if ( coverage >= 256 )
1250 coverage = 511 - coverage;
1255 if ( coverage >= 256 )
1259 if (
ras.render_span )
1266 span.coverage = (
unsigned char)coverage;
1268 ras.render_span(
y, 1, &
span,
ras.render_span_data );
1272 unsigned char*
q =
ras.target.origin -
ras.target.pitch *
y +
x;
1273 unsigned char c = (
unsigned char)coverage;
#define FT_MEM_SET(d, s, c)
GLint GLint GLint GLint GLint x
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
#define FT_OUTLINE_EVEN_ODD_FILL
GLdouble GLdouble GLdouble GLdouble q
GLint GLint GLint GLint GLint GLint y
GLenum GLenum GLvoid GLvoid GLvoid * span
Referenced by gray_sweep().
◆ gray_line_to()
Definition at line 1204 of file ftgrays.c.
static void gray_render_line(RAS_ARG_ TPos to_x, TPos to_y)
◆ gray_move_to()
Definition at line 1185 of file ftgrays.c.
GLint GLint GLint GLint GLint x
static void gray_set_cell(RAS_ARG_ TCoord ex, TCoord ey)
GLint GLint GLint GLint GLint GLint y
◆ gray_raster_done()
Definition at line 2011 of file ftgrays.c.
static char memory[1024 *256]
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
◆ gray_raster_new()
Definition at line 1992 of file ftgrays.c.
#define FT_ALLOC(ptr, size)
struct FT_RasterRec_ * FT_Raster
static char memory[1024 *256]
◆ gray_raster_render()
Definition at line 1848 of file ftgrays.c.
1855 #ifndef FT_STATIC_RASTER
1861 return FT_THROW( Invalid_Argument );
1868 return FT_THROW( Invalid_Outline );
1875 return FT_THROW( Invalid_Outline );
1879 return FT_THROW( Invalid_Outline );
1885 if ( !
params->gray_spans )
1895 return FT_THROW( Invalid_Argument );
1898 if ( !target_map->width || !target_map->rows )
1901 if ( !target_map->buffer )
1902 return FT_THROW( Invalid_Argument );
1904 if ( target_map->pitch < 0 )
1905 ras.target.origin = target_map->buffer;
1907 ras.target.origin = target_map->buffer
1908 + ( target_map->rows - 1 ) * (
unsigned int)target_map->pitch;
1910 ras.target.pitch = target_map->pitch;
1919 if ( cbox.
xMin < -0x1000000L || cbox.
xMax > 0x1000000L ||
1920 cbox.
yMin < -0x1000000L || cbox.
yMax > 0x1000000L )
1921 return FT_THROW( Invalid_Outline );
1926 cbox.
xMax = ( cbox.
xMax + 63 ) >> 6;
1927 cbox.
yMax = ( cbox.
yMax + 63 ) >> 6;
1935 clip.xMax = (
FT_Pos)target_map->width;
1936 clip.yMax = (
FT_Pos)target_map->rows;
1942 clip.xMin = -32768
L;
1943 clip.yMin = -32768
L;
1954 if (
ras.max_ex <=
ras.min_ex ||
ras.max_ey <=
ras.min_ey )
FT_BEGIN_HEADER typedef signed long FT_Pos
static int gray_convert_glyph(RAS_ARG)
#define FT_RASTER_FLAG_AA
#define FT_RASTER_FLAG_CLIP
GLenum const GLfloat * params
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
#define FT_RASTER_FLAG_DIRECT
#define FT_Raster_Span_Func
◆ gray_raster_reset()
◆ gray_raster_set_mode()
◆ gray_record_cell()
◆ gray_render_conic()
Definition at line 998 of file ftgrays.c.
1015 if ( (
TRUNC( arc[0].
y ) >=
ras.max_ey &&
1027 dx =
FT_ABS( arc[2].
x + arc[0].
x - 2 * arc[1].
x );
1028 dy =
FT_ABS( arc[2].
y + arc[0].
y - 2 * arc[1].
y );
1048 while ( ( draw &
split ) == 0 )
GLint GLint GLint GLint GLint x
static LPSTR * split(LPSTR s, LPINT args)
static void gray_render_line(RAS_ARG_ TPos to_x, TPos to_y)
GLint GLint GLint GLint GLint GLint y
static void gray_split_conic(FT_Vector *base)
Referenced by gray_conic_to().
◆ gray_render_cubic()
Definition at line 1091 of file ftgrays.c.
1098 TPos dx1, dy1, dx2, dy2;
1112 if ( (
TRUNC( arc[0].
y ) >=
ras.max_ey &&
1134 dx = dx_ = arc[3].
x - arc[0].
x;
1135 dy = dy_ = arc[3].
y - arc[0].
y;
1147 dx1 = arc[1].
x - arc[0].
x;
1148 dy1 = arc[1].
y - arc[0].
y;
1155 dx2 = arc[2].
x - arc[0].
x;
1156 dy2 = arc[2].
y - arc[0].
y;
1165 if ( dx1 * ( dx1 -
dx ) + dy1 * ( dy1 -
dy ) > 0 ||
1166 dx2 * ( dx2 -
dx ) + dy2 * ( dy2 -
dy ) > 0 )
1171 if ( arc == bez_stack )
GLint GLint GLint GLint GLint x
static void gray_split_cubic(FT_Vector *base)
static void gray_render_line(RAS_ARG_ TPos to_x, TPos to_y)
GLint GLint GLint GLint GLint GLint y
Referenced by gray_cubic_to().
◆ gray_render_line()
Definition at line 704 of file ftgrays.c.
716 if ( ( ey1 >=
ras.max_ey && ey2 >=
ras.max_ey ) ||
717 ( ey1 <
ras.min_ey && ey2 <
ras.min_ey ) )
826 }
while ( ey1 != ey2 );
static void gray_render_scanline(RAS_ARG_ TCoord ey, TPos x1, TCoord y1, TPos x2, TCoord y2)
GLint GLint GLint GLint GLint x
#define FT_DIV_MOD(type, dividend, divisor, quotient, remainder)
static void gray_set_cell(RAS_ARG_ TCoord ex, TCoord ey)
static Real area(Real A[2], Real B[2], Real C[2])
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Referenced by gray_line_to(), gray_render_conic(), and gray_render_cubic().
◆ gray_render_scanline()
Definition at line 606 of file ftgrays.c.
686 }
while ( ex1 != ex2 );
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
#define FT_DIV_MOD(type, dividend, divisor, quotient, remainder)
static void gray_set_cell(RAS_ARG_ TCoord ex, TCoord ey)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Referenced by gray_render_line().
◆ gray_set_cell()
◆ gray_split_conic()
◆ gray_split_cubic()
◆ gray_sweep()
Definition at line 1298 of file ftgrays.c.
1303 for (
y =
ras.min_ey;
y <
ras.max_ey;
y++ )
1311 for ( ; cell !=
NULL; cell = cell->
next )
1313 if ( cover != 0 && cell->
x >
x )
1319 if (
area != 0 && cell->
x >=
ras.min_ex )
GLint GLint GLint GLint GLint x
static void gray_hline(RAS_ARG_ TCoord x, TCoord y, TArea coverage, TCoord acount)
static Real area(Real A[2], Real B[2], Real C[2])
GLint GLint GLint GLint GLint GLint y
Referenced by gray_convert_glyph().