1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
/*******************************************************************
*
* ttraster.h v 1.4
*
* The FreeType glyph rasterizer.
*
* Copyright 1996-1999 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used
* modified and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
* NOTES:
*
* This version supports the following:
*
* - direct grayscaling
* - sub-banding
* - drop-out modes 4 and 5
* - second pass for complete drop-out control (bitmap only)
* - variable precision
*
*
* Changes between 1.4 and 1.3:
*
* Mainly performance tunings:
*
* - Line_Down() and Bezier_Down() now use the functions Line_Up()
* and Bezier_Up() to do their work.
* - optimized Split_Bezier()
* - optimized linked lists used during sweeps
*
* Changes between 1.2 and 1.3:
*
* - made the engine optionaly re-entrant. Saves a lot
* of code for a moderate performance hit.
*
******************************************************************/
#ifndef TTRASTER_H
#define TTRASTER_H
#include "ttconfig.h"
#include "freetype.h" /* for TT_Outline */
#include "ttengine.h"
#ifdef __cplusplus
extern "C" {
#endif
/* We provide two different builds of the scan-line converter */
/* The static build uses global variables and isn't */
/* re-entrant. */
/* The indirect build is re-entrant but accesses all variables */
/* indirectly. */
/* */
/* As a consequence, the indirect build is about 10% slower */
/* than the static one on a _Pentium_ (this could get worse */
/* on older processors), but the code size is reduced by */
/* more than 30% ! */
/* */
/* The indirect build is now the default, defined in */
/* ttconfig.h. Be careful if you experiment with this. */
/* Note also that, though its code can be re-entrant, the */
/* component is always used in thread-safe mode. This is */
/* simply due to the fact that we want to use a single */
/* render pool (of 64 Kb), and not to waste memory. */
#ifdef TT_STATIC_RASTER
#define RAS_ARGS /* void */
#define RAS_ARG /* void */
#define RAS_VARS /* void */
#define RAS_VAR /* void */
#else
#define RAS_ARGS TRaster_Instance* raster,
#define RAS_ARG TRaster_Instance* raster
#define RAS_VARS raster,
#define RAS_VAR raster
#endif
struct TRaster_Instance_;
typedef struct TRaster_Instance_ TRaster_Instance;
/* Render one glyph in the target bitmap, using drop-out control */
/* mode 'scan'. */
LOCAL_DEF
TT_Error Render_Glyph( RAS_ARGS TT_Outline* glyph,
TT_Raster_Map* target );
#ifdef TT_CONFIG_OPTION_GRAY_SCALING
/* Render one gray-level glyph in the target pixmap. */
/* Palette points to an array of 5 colors used for the rendering. */
/* Use NULL to reuse the last palette. Default is VGA graylevels. */
LOCAL_DEF
TT_Error Render_Gray_Glyph( RAS_ARGS TT_Outline* glyph,
TT_Raster_Map* target,
Byte* palette );
#endif
/* Initialize rasterizer */
LOCAL_DEF
TT_Error TTRaster_Init( PEngine_Instance engine );
/* Finalize it */
LOCAL_DEF
TT_Error TTRaster_Done( PEngine_Instance engine );
#ifdef __cplusplus
}
#endif
#endif /* TTRASTER_H */
/* END */
|