Whitespace & documentation improvements.
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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 4547dc9..413b8f5 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -73,13 +73,15 @@
/* profile is simply an array of scanline intersections on a given */
/* dimension. A profile's main attributes are */
/* */
- /* o its scanline position boundaries, i.e. `Ymin' and `Ymax'. */
+ /* o its scanline position boundaries, i.e. `Ymin' and `Ymax' */
/* */
/* o an array of intersection coordinates for each scanline */
- /* between `Ymin' and `Ymax'. */
+ /* between `Ymin' and `Ymax' */
/* */
/* o a direction, indicating whether it was built going `up' or */
- /* `down', as this is very important for filling rules. */
+ /* `down', as this is very important for filling rules */
+ /* */
+ /* o its drop-out mode */
/* */
/* 2 - Sweeping the target map's scanlines in order to compute segment */
/* `spans' which are then filled. Additionally, this pass */
@@ -89,15 +91,15 @@
/* built from the bottom of the render pool, used as a stack. The */
/* following graphics shows the profile list under construction: */
/* */
- /* ____________________________________________________________ _ _ */
- /* | | | | | */
- /* | profile | coordinates for | profile | coordinates for |--> */
- /* | 1 | profile 1 | 2 | profile 2 |--> */
- /* |_________|___________________|_________|_________________|__ _ _ */
+ /* __________________________________________________________ _ _ */
+ /* | | | | | */
+ /* | profile | coordinates for | profile | coordinates for |--> */
+ /* | 1 | profile 1 | 2 | profile 2 |--> */
+ /* |_________|_________________|_________|_________________|__ _ _ */
/* */
- /* ^ ^ */
- /* | | */
- /* start of render pool top */
+ /* ^ ^ */
+ /* | | */
+ /* start of render pool top */
/* */
/* The top of the profile stack is kept in the `top' variable. */
/* */
@@ -200,7 +202,8 @@
#define ft_memset memset
-#else /* _STANDALONE_ */
+
+#else /* !_STANDALONE_ */
#include FT_INTERNAL_OBJECTS_H
@@ -216,7 +219,7 @@
#define Raster_Err_Unsupported Raster_Err_Cannot_Render_Glyph
-#endif /* _STANDALONE_ */
+#endif /* !_STANDALONE_ */
#ifndef FT_MEM_SET
@@ -374,7 +377,7 @@
#define FT_UNUSED_RASTER do { } while ( 0 )
-#else /* FT_STATIC_RASTER */
+#else /* !FT_STATIC_RASTER */
#define RAS_ARGS PWorker worker,
@@ -386,7 +389,7 @@
#define FT_UNUSED_RASTER FT_UNUSED( worker )
-#endif /* FT_STATIC_RASTER */
+#endif /* !FT_STATIC_RASTER */
typedef struct TWorker_ TWorker, *PWorker;
@@ -419,65 +422,65 @@
#define IS_BOTTOM_OVERSHOOT( x ) ( CEILING( x ) - x >= ras.precision_half )
#define IS_TOP_OVERSHOOT( x ) ( x - FLOOR( x ) >= ras.precision_half )
- /* Note that I have moved the location of some fields in the */
- /* structure to ensure that the most used variables are used */
- /* at the top. Thus, their offset can be coded with less */
- /* opcodes, and it results in a smaller executable. */
+ /* The most used variables are positioned at the top of the structure. */
+ /* Thus, their offset can be coded with less opcodes, resulting in a */
+ /* smaller executable. */
struct TWorker_
{
- Int precision_bits; /* precision related variables */
- Int precision;
- Int precision_half;
- Long precision_mask;
- Int precision_shift;
- Int precision_step;
- Int precision_jitter;
-
- Int scale_shift; /* == precision_shift for bitmaps */
+ Int precision_bits; /* precision related variables */
+ Int precision;
+ Int precision_half;
+ Long precision_mask;
+ Int precision_shift;
+ Int precision_step;
+ Int precision_jitter;
+
+ Int scale_shift; /* == precision_shift for bitmaps */
/* == precision_shift+1 for pixmaps */
- PLong buff; /* The profiles buffer */
- PLong sizeBuff; /* Render pool size */
- PLong maxBuff; /* Profiles buffer size */
- PLong top; /* Current cursor in buffer */
+ PLong buff; /* The profiles buffer */
+ PLong sizeBuff; /* Render pool size */
+ PLong maxBuff; /* Profiles buffer size */
+ PLong top; /* Current cursor in buffer */
- FT_Error error;
+ FT_Error error;
- Int numTurns; /* number of Y-turns in outline */
+ Int numTurns; /* number of Y-turns in outline */
- TPoint* arc; /* current Bezier arc pointer */
+ TPoint* arc; /* current Bezier arc pointer */
- UShort bWidth; /* target bitmap width */
- PByte bTarget; /* target bitmap buffer */
- PByte gTarget; /* target pixmap buffer */
+ UShort bWidth; /* target bitmap width */
+ PByte bTarget; /* target bitmap buffer */
+ PByte gTarget; /* target pixmap buffer */
- Long lastX, lastY, minY, maxY;
+ Long lastX, lastY;
+ Long minY, maxY;
- UShort num_Profs; /* current number of profiles */
+ UShort num_Profs; /* current number of profiles */
- Bool fresh; /* signals a fresh new profile which */
+ Bool fresh; /* signals a fresh new profile which */
/* `start' field must be completed */
- Bool joint; /* signals that the last arc ended */
+ Bool joint; /* signals that the last arc ended */
/* exactly on a scanline. Allows */
/* removal of doublets */
- PProfile cProfile; /* current profile */
- PProfile fProfile; /* head of linked list of profiles */
- PProfile gProfile; /* contour's first profile in case */
+ PProfile cProfile; /* current profile */
+ PProfile fProfile; /* head of linked list of profiles */
+ PProfile gProfile; /* contour's first profile in case */
/* of impact */
- TStates state; /* rendering state */
+ TStates state; /* rendering state */
FT_Bitmap target; /* description of target bit/pixmap */
FT_Outline outline;
- Long traceOfs; /* current offset in target bitmap */
- Long traceG; /* current offset in target pixmap */
+ Long traceOfs; /* current offset in target bitmap */
+ Long traceG; /* current offset in target pixmap */
- Short traceIncr; /* sweep's increment in target bitmap */
+ Short traceIncr; /* sweep's increment in target bitmap */
- Short gray_min_x; /* current min x during gray rendering */
- Short gray_max_x; /* current max x during gray rendering */
+ Short gray_min_x; /* current min x during gray rendering */
+ Short gray_max_x; /* current max x during gray rendering */
/* dispatch variables */
@@ -486,31 +489,31 @@
Function_Sweep_Span* Proc_Sweep_Drop;
Function_Sweep_Step* Proc_Sweep_Step;
- Byte dropOutControl; /* current drop_out control method */
+ Byte dropOutControl; /* current drop_out control method */
- Bool second_pass; /* indicates whether a horizontal pass */
+ Bool second_pass; /* indicates whether a horizontal pass */
/* should be performed to control */
/* drop-out accurately when calling */
/* Render_Glyph. Note that there is */
/* no horizontal pass during gray */
/* rendering. */
- TPoint arcs[3 * MaxBezier + 1]; /* The Bezier stack */
+ TPoint arcs[3 * MaxBezier + 1]; /* The Bezier stack */
- TBand band_stack[16]; /* band stack used for sub-banding */
- Int band_top; /* band stack top */
+ TBand band_stack[16]; /* band stack used for sub-banding */
+ Int band_top; /* band stack top */
#ifdef FT_RASTER_OPTION_ANTI_ALIASING
- Byte* grays;
+ Byte* grays;
- Byte gray_lines[RASTER_GRAY_LINES];
+ Byte gray_lines[RASTER_GRAY_LINES];
/* Intermediate table used to render the */
/* graylevels pixmaps. */
/* gray_lines is a buffer holding two */
/* monochrome scanlines */
- Short gray_width; /* width in bytes of one monochrome */
+ Short gray_width; /* width in bytes of one monochrome */
/* intermediate scanline of gray_lines. */
/* Each gray pixel takes 2 bits long there */
@@ -524,12 +527,12 @@
typedef struct TRaster_
{
- char* buffer;
- long buffer_size;
- void* memory;
- PWorker worker;
- Byte grays[5];
- Short gray_width;
+ char* buffer;
+ long buffer_size;
+ void* memory;
+ PWorker worker;
+ Byte grays[5];
+ Short gray_width;
} TRaster, *PRaster;
@@ -538,11 +541,11 @@
static TWorker cur_ras;
#define ras cur_ras
-#else
+#else /* !FT_STATIC_RASTER */
#define ras (*worker)
-#endif /* FT_STATIC_RASTER */
+#endif /* !FT_STATIC_RASTER */
#ifdef FT_RASTER_OPTION_ANTI_ALIASING