Alexei Podtelezhnikov pushed to branch remove-grblit at FreeType / FreeType Demo Programs
Commits:
-
d235ea94
by Werner Lemberg at 2021-11-15T17:16:00+01:00
-
66991afe
by Werner Lemberg at 2021-11-15T17:16:00+01:00
-
20abd57e
by Alexei Podtelezhnikov at 2021-11-17T03:10:02+00:00
20 changed files:
- builds/windows/msvc/migs.vcxproj
- graph/graph.h
- − graph/grblit.c
- − graph/grblit.h
- graph/grconfig.h
- graph/grfont.c
- graph/meson.build
- graph/rules.mk
- src/ftbench.c
- src/ftcommon.c
- src/ftdump.c
- src/ftgrid.c
- src/ftlint.c
- src/ftmulti.c
- src/ftpngout.c
- src/ftsdf.c
- src/ftstring.c
- src/ftview.c
- src/strbuf.c
- vms_make.com
Changes:
... | ... | @@ -142,7 +142,6 @@ |
142 | 142 |
<ItemGroup>
|
143 | 143 |
<ClCompile Include="..\..\..\graph\gblblit.c" />
|
144 | 144 |
<ClCompile Include="..\..\..\graph\gblender.c" />
|
145 |
- <ClCompile Include="..\..\..\graph\grblit.c" />
|
|
146 | 145 |
<ClCompile Include="..\..\..\graph\grdevice.c" />
|
147 | 146 |
<ClCompile Include="..\..\..\graph\grfill.c" />
|
148 | 147 |
<ClCompile Include="..\..\..\graph\grfont.c" />
|
... | ... | @@ -166,7 +165,6 @@ |
166 | 165 |
<ClInclude Include="..\..\..\graph\gblvbgr.h" />
|
167 | 166 |
<ClInclude Include="..\..\..\graph\gblvrgb.h" />
|
168 | 167 |
<ClInclude Include="..\..\..\graph\graph.h" />
|
169 |
- <ClInclude Include="..\..\..\graph\grblit.h" />
|
|
170 | 168 |
<ClInclude Include="..\..\..\graph\grconfig.h" />
|
171 | 169 |
<ClInclude Include="..\..\..\graph\grdevice.h" />
|
172 | 170 |
<ClInclude Include="..\..\..\graph\grevents.h" />
|
... | ... | @@ -194,47 +194,6 @@ |
194 | 194 |
grBitmap *bit );
|
195 | 195 |
|
196 | 196 |
|
197 |
- /**********************************************************************
|
|
198 |
- *
|
|
199 |
- * <Function>
|
|
200 |
- * grBlitGlyphToBitmap
|
|
201 |
- *
|
|
202 |
- * <Description>
|
|
203 |
- * writes a given glyph bitmap to a target surface.
|
|
204 |
- *
|
|
205 |
- * <Input>
|
|
206 |
- * target :: handle to target bitmap that belongs to surface
|
|
207 |
- * glyph :: handle to source glyph bitmap
|
|
208 |
- * x :: position of left-most pixel of glyph image in target surface
|
|
209 |
- * y :: position of top-most pixel of glyph image in target surface
|
|
210 |
- * color :: color to be used to draw a monochrome glyph
|
|
211 |
- *
|
|
212 |
- * <Return>
|
|
213 |
- * Error code. 0 means success
|
|
214 |
- *
|
|
215 |
- * <Note>
|
|
216 |
- * There are only two supported source pixel modes : monochrome
|
|
217 |
- * and gray. The 8-bit images can have any number of grays between
|
|
218 |
- * 2 and 128, and conversions to the target surface is handled
|
|
219 |
- * _automatically_.
|
|
220 |
- *
|
|
221 |
- * Note however that you should avoid blitting a gray glyph to a gray
|
|
222 |
- * bitmap with fewer levels of grays, as this would much probably
|
|
223 |
- * give unpleasant results..
|
|
224 |
- *
|
|
225 |
- * This function performs clipping. This function does not implement
|
|
226 |
- * gamma correction.
|
|
227 |
- *
|
|
228 |
- **********************************************************************/
|
|
229 |
- |
|
230 |
- extern int
|
|
231 |
- grBlitGlyphToBitmap( grBitmap* target,
|
|
232 |
- grBitmap* glyph,
|
|
233 |
- grPos x,
|
|
234 |
- grPos y,
|
|
235 |
- grColor color );
|
|
236 |
- |
|
237 |
- |
|
238 | 197 |
/**********************************************************************
|
239 | 198 |
*
|
240 | 199 |
* <Function>
|
1 |
-/****************************************************************************/
|
|
2 |
-/* */
|
|
3 |
-/* The FreeType project -- a free and portable quality TrueType renderer. */
|
|
4 |
-/* */
|
|
5 |
-/* Copyright (C) 1996-2021 by */
|
|
6 |
-/* D. Turner, R.Wilhelm, and W. Lemberg */
|
|
7 |
-/* */
|
|
8 |
-/* grblit.c: Support for blitting of bitmaps with various depth. */
|
|
9 |
-/* */
|
|
10 |
-/****************************************************************************/
|
|
11 |
- |
|
12 |
-#include "grblit.h"
|
|
13 |
-#include <string.h>
|
|
14 |
- |
|
15 |
-#define GRAY8
|
|
16 |
- |
|
17 |
- static
|
|
18 |
- int compute_clips( grBlitter* blit,
|
|
19 |
- int x_offset,
|
|
20 |
- int y_offset )
|
|
21 |
- {
|
|
22 |
- int xmin, ymin, xmax, ymax, width, height, target_width;
|
|
23 |
- |
|
24 |
- /* perform clipping and setup variables */
|
|
25 |
- width = blit->source.width;
|
|
26 |
- height = blit->source.rows;
|
|
27 |
- |
|
28 |
- switch ( blit->source.mode )
|
|
29 |
- {
|
|
30 |
- case gr_pixel_mode_mono:
|
|
31 |
- width = (width + 7) & -8;
|
|
32 |
- break;
|
|
33 |
- |
|
34 |
- case gr_pixel_mode_pal4:
|
|
35 |
- width = (width + 1) & -2;
|
|
36 |
- break;
|
|
37 |
- |
|
38 |
- case gr_pixel_mode_lcd:
|
|
39 |
- case gr_pixel_mode_lcd2:
|
|
40 |
- width /= 3;
|
|
41 |
- break;
|
|
42 |
- |
|
43 |
- case gr_pixel_mode_lcdv:
|
|
44 |
- case gr_pixel_mode_lcdv2:
|
|
45 |
- height /= 3;
|
|
46 |
- break;
|
|
47 |
- |
|
48 |
- default:
|
|
49 |
- ;
|
|
50 |
- }
|
|
51 |
- |
|
52 |
- xmin = x_offset;
|
|
53 |
- ymin = y_offset;
|
|
54 |
- xmax = xmin + width-1;
|
|
55 |
- ymax = ymin + height-1;
|
|
56 |
- |
|
57 |
- /* clip if necessary */
|
|
58 |
- if ( width == 0 || height == 0 ||
|
|
59 |
- xmax < 0 || xmin >= blit->target.width ||
|
|
60 |
- ymax < 0 || ymin >= blit->target.rows )
|
|
61 |
- return 1;
|
|
62 |
- |
|
63 |
- /* set up clipping and cursors */
|
|
64 |
- blit->yread = 0;
|
|
65 |
- if ( ymin < 0 )
|
|
66 |
- {
|
|
67 |
- blit->yread -= ymin;
|
|
68 |
- height += ymin;
|
|
69 |
- blit->ywrite = 0;
|
|
70 |
- }
|
|
71 |
- else
|
|
72 |
- blit->ywrite = ymin;
|
|
73 |
- |
|
74 |
- if ( ymax >= blit->target.rows )
|
|
75 |
- height -= ymax - blit->target.rows + 1;
|
|
76 |
- |
|
77 |
- blit->xread = 0;
|
|
78 |
- if ( xmin < 0 )
|
|
79 |
- {
|
|
80 |
- blit->xread -= xmin;
|
|
81 |
- width += xmin;
|
|
82 |
- blit->xwrite = 0;
|
|
83 |
- }
|
|
84 |
- else
|
|
85 |
- blit->xwrite = xmin;
|
|
86 |
- |
|
87 |
- target_width = blit->target.width;
|
|
88 |
- |
|
89 |
- switch ( blit->target.mode )
|
|
90 |
- {
|
|
91 |
- case gr_pixel_mode_mono:
|
|
92 |
- target_width = (target_width + 7) & -8;
|
|
93 |
- break;
|
|
94 |
- case gr_pixel_mode_pal4:
|
|
95 |
- target_width = (target_width + 1) & -2;
|
|
96 |
- break;
|
|
97 |
- |
|
98 |
- default:
|
|
99 |
- ;
|
|
100 |
- }
|
|
101 |
- |
|
102 |
- blit->right_clip = xmax - target_width + 1;
|
|
103 |
- if ( blit->right_clip > 0 )
|
|
104 |
- width -= blit->right_clip;
|
|
105 |
- else
|
|
106 |
- blit->right_clip = 0;
|
|
107 |
- |
|
108 |
- blit->width = width;
|
|
109 |
- blit->height = height;
|
|
110 |
- |
|
111 |
- /* set read and write to the top-left corner of the read */
|
|
112 |
- /* and write areas before clipping. */
|
|
113 |
- |
|
114 |
- blit->read = blit->source.buffer;
|
|
115 |
- blit->write = blit->target.buffer;
|
|
116 |
- |
|
117 |
- blit->read_line = blit->source.pitch;
|
|
118 |
- blit->write_line = blit->target.pitch;
|
|
119 |
- |
|
120 |
- if ( blit->read_line < 0 )
|
|
121 |
- blit->read -= (blit->source.rows-1) * blit->read_line;
|
|
122 |
- |
|
123 |
- if ( blit->write_line < 0 )
|
|
124 |
- blit->write -= (blit->target.rows-1) * blit->write_line;
|
|
125 |
- |
|
126 |
- /* now go to the start line. Note that we do not move the */
|
|
127 |
- /* x position yet, as this is dependent on the pixel format */
|
|
128 |
- blit->read += blit->yread * blit->read_line;
|
|
129 |
- blit->write += blit->ywrite * blit->write_line;
|
|
130 |
- |
|
131 |
- return 0;
|
|
132 |
- }
|
|
133 |
- |
|
134 |
- |
|
135 |
-/**************************************************************************/
|
|
136 |
-/* */
|
|
137 |
-/* <Function> blit_mono_to_mono */
|
|
138 |
-/* */
|
|
139 |
-/**************************************************************************/
|
|
140 |
- |
|
141 |
- static
|
|
142 |
- void blit_mono_to_mono( grBlitter* blit,
|
|
143 |
- grColor color )
|
|
144 |
- {
|
|
145 |
- unsigned int shift;
|
|
146 |
- int left_clip, x, y;
|
|
147 |
- |
|
148 |
- byte* read;
|
|
149 |
- byte* write;
|
|
150 |
- |
|
151 |
- (void)color; /* unused argument */
|
|
152 |
- |
|
153 |
- left_clip = ( blit->xread > 0 );
|
|
154 |
- shift = (unsigned int)( blit->xwrite - blit->xread ) & 7;
|
|
155 |
- |
|
156 |
- read = blit->read + (blit->xread >> 3);
|
|
157 |
- write = blit->write + (blit->xwrite >> 3);
|
|
158 |
- |
|
159 |
- if ( shift == 0 )
|
|
160 |
- {
|
|
161 |
- y = blit->height;
|
|
162 |
- do
|
|
163 |
- {
|
|
164 |
- byte* _read = read;
|
|
165 |
- byte* _write = write;
|
|
166 |
- |
|
167 |
- x = blit->width;
|
|
168 |
- |
|
169 |
- do
|
|
170 |
- {
|
|
171 |
- *_write++ |= *_read++;
|
|
172 |
- x -= 8;
|
|
173 |
- } while ( x > 0 );
|
|
174 |
- |
|
175 |
- read += blit->read_line;
|
|
176 |
- write += blit->write_line;
|
|
177 |
- y--;
|
|
178 |
- } while ( y > 0 );
|
|
179 |
- }
|
|
180 |
- else
|
|
181 |
- {
|
|
182 |
- int first, last, count;
|
|
183 |
- |
|
184 |
- |
|
185 |
- first = blit->xwrite >> 3;
|
|
186 |
- last = (blit->xwrite + blit->width-1) >> 3;
|
|
187 |
- |
|
188 |
- count = last - first;
|
|
189 |
- |
|
190 |
- if ( blit->right_clip )
|
|
191 |
- count++;
|
|
192 |
- |
|
193 |
- y = blit->height;
|
|
194 |
- |
|
195 |
- do
|
|
196 |
- {
|
|
197 |
- unsigned char* _read = read;
|
|
198 |
- unsigned char* _write = write;
|
|
199 |
- unsigned int old;
|
|
200 |
- unsigned int shift2 = (8-shift);
|
|
201 |
- |
|
202 |
- if ( left_clip )
|
|
203 |
- old = (unsigned int)(*_read++) << shift2;
|
|
204 |
- else
|
|
205 |
- old = 0;
|
|
206 |
- |
|
207 |
- x = count;
|
|
208 |
- while ( x > 0 )
|
|
209 |
- {
|
|
210 |
- unsigned int val = *_read++;
|
|
211 |
- |
|
212 |
- *_write++ |= (unsigned char)( (val >> shift) | old );
|
|
213 |
- old = val << shift2;
|
|
214 |
- x--;
|
|
215 |
- }
|
|
216 |
- |
|
217 |
- if ( !blit->right_clip )
|
|
218 |
- *_write |= (unsigned char)old;
|
|
219 |
- |
|
220 |
- read += blit->read_line;
|
|
221 |
- write += blit->write_line;
|
|
222 |
- y--;
|
|
223 |
- |
|
224 |
- } while ( y > 0 );
|
|
225 |
- }
|
|
226 |
- }
|
|
227 |
- |
|
228 |
- |
|
229 |
-/**************************************************************************/
|
|
230 |
-/* */
|
|
231 |
-/* <Function> blit_mono_to_pal8 */
|
|
232 |
-/* */
|
|
233 |
-/**************************************************************************/
|
|
234 |
- |
|
235 |
- static
|
|
236 |
- void blit_mono_to_pal8( grBlitter* blit,
|
|
237 |
- grColor color )
|
|
238 |
- {
|
|
239 |
- int x, y;
|
|
240 |
- unsigned char* write = blit->write + blit->xwrite;
|
|
241 |
- unsigned char* read = blit->read + ( blit->xread >> 3 );
|
|
242 |
- unsigned int mask = 0x80 >> ( blit->xread & 7 );
|
|
243 |
- |
|
244 |
- y = blit->height;
|
|
245 |
- do
|
|
246 |
- {
|
|
247 |
- unsigned char* _write = write;
|
|
248 |
- unsigned char* _read = read;
|
|
249 |
- unsigned int _mask = mask;
|
|
250 |
- unsigned int val = *_read;
|
|
251 |
- |
|
252 |
- x = blit->width;
|
|
253 |
- do
|
|
254 |
- {
|
|
255 |
- if ( !_mask )
|
|
256 |
- {
|
|
257 |
- val = *++_read;
|
|
258 |
- _mask = 0x80;
|
|
259 |
- }
|
|
260 |
- |
|
261 |
- if ( val & _mask )
|
|
262 |
- *_write = (unsigned char)color.value;
|
|
263 |
- |
|
264 |
- _mask >>= 1;
|
|
265 |
- _write++;
|
|
266 |
- |
|
267 |
- } while ( --x > 0 );
|
|
268 |
- |
|
269 |
- read += blit->read_line;
|
|
270 |
- write += blit->write_line;
|
|
271 |
- y--;
|
|
272 |
- } while ( y > 0 );
|
|
273 |
- }
|
|
274 |
- |
|
275 |
- |
|
276 |
-/**************************************************************************/
|
|
277 |
-/* */
|
|
278 |
-/* <Function> blit_mono_to_pal4 */
|
|
279 |
-/* */
|
|
280 |
-/**************************************************************************/
|
|
281 |
- |
|
282 |
- static
|
|
283 |
- void blit_mono_to_pal4( grBlitter* blit,
|
|
284 |
- grColor color )
|
|
285 |
- {
|
|
286 |
- int x, y;
|
|
287 |
- unsigned char* write = blit->write + ( blit->xwrite >> 1 );
|
|
288 |
- unsigned int phase = blit->xwrite & 1 ? 0x0F : 0xF0;
|
|
289 |
- unsigned char* read = blit->read + ( blit->xread >> 3 );
|
|
290 |
- unsigned int mask = 0x80 >> ( blit->xread & 7 );
|
|
291 |
- unsigned int col = color.value | ( color.value << 4 );
|
|
292 |
- |
|
293 |
- y = blit->height;
|
|
294 |
- do
|
|
295 |
- {
|
|
296 |
- unsigned char* _write = write;
|
|
297 |
- unsigned int _phase = phase;
|
|
298 |
- unsigned char* _read = read;
|
|
299 |
- unsigned int _mask = mask;
|
|
300 |
- unsigned int val = *_read;
|
|
301 |
- |
|
302 |
- x = blit->width;
|
|
303 |
- do
|
|
304 |
- {
|
|
305 |
- if ( !_mask )
|
|
306 |
- {
|
|
307 |
- val = *++_read;
|
|
308 |
- _mask = 0x80;
|
|
309 |
- }
|
|
310 |
- |
|
311 |
- if ( val & _mask )
|
|
312 |
- *_write = (unsigned char)( (col & _phase) | (*_write & ~_phase) );
|
|
313 |
- |
|
314 |
- _mask >>= 1;
|
|
315 |
- _write += _phase & 1;
|
|
316 |
- _phase = ~_phase;
|
|
317 |
- x--;
|
|
318 |
- } while ( x > 0 );
|
|
319 |
- |
|
320 |
- read += blit->read_line;
|
|
321 |
- write += blit->write_line;
|
|
322 |
- y--;
|
|
323 |
- } while ( y > 0 );
|
|
324 |
- }
|
|
325 |
- |
|
326 |
- |
|
327 |
-/**************************************************************************/
|
|
328 |
-/* */
|
|
329 |
-/* <Function> blit_mono_to_rgb16 */
|
|
330 |
-/* */
|
|
331 |
-/**************************************************************************/
|
|
332 |
- |
|
333 |
- static
|
|
334 |
- void blit_mono_to_rgb16( grBlitter* blit,
|
|
335 |
- grColor color )
|
|
336 |
- {
|
|
337 |
- int x, y;
|
|
338 |
- unsigned char* write = blit->write + blit->xwrite * 2;
|
|
339 |
- unsigned char* read = blit->read + ( blit->xread >> 3 );
|
|
340 |
- unsigned int mask = 0x80 >> ( blit->xread & 7 );
|
|
341 |
- |
|
342 |
- y = blit->height;
|
|
343 |
- do
|
|
344 |
- {
|
|
345 |
- unsigned short* _write = (unsigned short*)write;
|
|
346 |
- unsigned char* _read = read;
|
|
347 |
- unsigned int _mask = mask;
|
|
348 |
- unsigned int val = *_read;
|
|
349 |
- |
|
350 |
- x = blit->width;
|
|
351 |
- do
|
|
352 |
- {
|
|
353 |
- if ( !_mask )
|
|
354 |
- {
|
|
355 |
- val = *++_read;
|
|
356 |
- _mask = 0x80;
|
|
357 |
- }
|
|
358 |
- |
|
359 |
- if ( val & _mask )
|
|
360 |
- *_write = (unsigned short)color.value;
|
|
361 |
- |
|
362 |
- _mask >>= 1;
|
|
363 |
- _write++;
|
|
364 |
- x--;
|
|
365 |
- } while ( x > 0 );
|
|
366 |
- |
|
367 |
- read += blit->read_line;
|
|
368 |
- write += blit->write_line;
|
|
369 |
- y--;
|
|
370 |
- } while ( y > 0 );
|
|
371 |
- }
|
|
372 |
- |
|
373 |
- |
|
374 |
-/**************************************************************************/
|
|
375 |
-/* */
|
|
376 |
-/* <Function> blit_mono_to_rgb24 */
|
|
377 |
-/* */
|
|
378 |
-/**************************************************************************/
|
|
379 |
- |
|
380 |
- static
|
|
381 |
- void blit_mono_to_rgb24( grBlitter* blit,
|
|
382 |
- grColor color )
|
|
383 |
- {
|
|
384 |
- int x, y;
|
|
385 |
- unsigned char* write = blit->write + blit->xwrite * 3;
|
|
386 |
- unsigned char* read = blit->read + ( blit->xread >> 3 );
|
|
387 |
- unsigned int mask = 0x80 >> ( blit->xread & 7 );
|
|
388 |
- |
|
389 |
- y = blit->height;
|
|
390 |
- do
|
|
391 |
- {
|
|
392 |
- unsigned char* _write = write;
|
|
393 |
- unsigned char* _read = read;
|
|
394 |
- unsigned int _mask = mask;
|
|
395 |
- unsigned int val = *_read;
|
|
396 |
- |
|
397 |
- x = blit->width;
|
|
398 |
- do
|
|
399 |
- {
|
|
400 |
- if ( !_mask )
|
|
401 |
- {
|
|
402 |
- val = *++_read;
|
|
403 |
- _mask = 0x80;
|
|
404 |
- }
|
|
405 |
- |
|
406 |
- if ( val & _mask )
|
|
407 |
- {
|
|
408 |
- _write[0] = color.chroma[0];
|
|
409 |
- _write[1] = color.chroma[1];
|
|
410 |
- _write[2] = color.chroma[2];
|
|
411 |
- }
|
|
412 |
- |
|
413 |
- _mask >>= 1;
|
|
414 |
- _write += 3;
|
|
415 |
- x--;
|
|
416 |
- } while ( x > 0 );
|
|
417 |
- |
|
418 |
- read += blit->read_line;
|
|
419 |
- write += blit->write_line;
|
|
420 |
- y--;
|
|
421 |
- } while ( y > 0 );
|
|
422 |
- }
|
|
423 |
- |
|
424 |
- |
|
425 |
-/**************************************************************************/
|
|
426 |
-/* */
|
|
427 |
-/* <Function> blit_mono_to_rgb32 */
|
|
428 |
-/* */
|
|
429 |
-/**************************************************************************/
|
|
430 |
- |
|
431 |
- static
|
|
432 |
- void blit_mono_to_rgb32( grBlitter* blit,
|
|
433 |
- grColor color )
|
|
434 |
- {
|
|
435 |
- int x, y;
|
|
436 |
- unsigned char* write = blit->write + blit->xwrite * 4;
|
|
437 |
- unsigned char* read = blit->read + ( blit->xread >> 3 );
|
|
438 |
- unsigned int mask = 0x80 >> ( blit->xread & 7 );
|
|
439 |
- |
|
440 |
- y = blit->height;
|
|
441 |
- do
|
|
442 |
- {
|
|
443 |
- uint32_t* _write = (uint32_t*)write;
|
|
444 |
- unsigned char* _read = read;
|
|
445 |
- unsigned int _mask = mask;
|
|
446 |
- unsigned int val = *_read;
|
|
447 |
- |
|
448 |
- x = blit->width;
|
|
449 |
- do
|
|
450 |
- {
|
|
451 |
- if ( !_mask )
|
|
452 |
- {
|
|
453 |
- val = *++_read;
|
|
454 |
- _mask = 0x80;
|
|
455 |
- }
|
|
456 |
- |
|
457 |
- if ( val & _mask )
|
|
458 |
- *_write = color.value;
|
|
459 |
- |
|
460 |
- _mask >>= 1;
|
|
461 |
- _write++;
|
|
462 |
- x--;
|
|
463 |
- |
|
464 |
- } while ( x > 0 );
|
|
465 |
- |
|
466 |
- read += blit->read_line;
|
|
467 |
- write += blit->write_line;
|
|
468 |
- y--;
|
|
469 |
- |
|
470 |
- } while ( y > 0 );
|
|
471 |
- }
|
|
472 |
- |
|
473 |
- |
|
474 |
- static
|
|
475 |
- const grBlitterFunc gr_mono_blitters[gr_pixel_mode_max] =
|
|
476 |
- {
|
|
477 |
- 0,
|
|
478 |
- blit_mono_to_mono,
|
|
479 |
- blit_mono_to_pal4,
|
|
480 |
- blit_mono_to_pal8,
|
|
481 |
- blit_mono_to_pal8,
|
|
482 |
- blit_mono_to_rgb16,
|
|
483 |
- blit_mono_to_rgb16,
|
|
484 |
- blit_mono_to_rgb24,
|
|
485 |
- blit_mono_to_rgb32
|
|
486 |
- };
|
|
487 |
- |
|
488 |
- |
|
489 |
- /*******************************************************************/
|
|
490 |
- /* */
|
|
491 |
- /* Saturation tables */
|
|
492 |
- /* */
|
|
493 |
- /*******************************************************************/
|
|
494 |
- |
|
495 |
- typedef struct grSaturation_
|
|
496 |
- {
|
|
497 |
- int count;
|
|
498 |
- const byte* table;
|
|
499 |
- |
|
500 |
- } grSaturation;
|
|
501 |
- |
|
502 |
- |
|
503 |
- static
|
|
504 |
- const byte gr_saturation_5[8] = { 0, 1, 2, 3, 4, 4, 4, 4 };
|
|
505 |
- |
|
506 |
- |
|
507 |
- static
|
|
508 |
- const byte gr_saturation_17[32] =
|
|
509 |
- {
|
|
510 |
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
|
511 |
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
|
|
512 |
- };
|
|
513 |
- |
|
514 |
- |
|
515 |
- static
|
|
516 |
- grSaturation gr_saturations[ GR_MAX_SATURATIONS ] =
|
|
517 |
- {
|
|
518 |
- { 5, gr_saturation_5 },
|
|
519 |
- { 17, gr_saturation_17 }
|
|
520 |
- };
|
|
521 |
- |
|
522 |
- static
|
|
523 |
- int gr_num_saturations = 2;
|
|
524 |
- |
|
525 |
- static
|
|
526 |
- grSaturation* gr_last_saturation = gr_saturations;
|
|
527 |
- |
|
528 |
- |
|
529 |
- static const byte*
|
|
530 |
- grGetSaturation( int num_grays )
|
|
531 |
- {
|
|
532 |
- /* first of all, scan the current saturations table */
|
|
533 |
- grSaturation* sat = gr_saturations;
|
|
534 |
- grSaturation* limit = sat + gr_num_saturations;
|
|
535 |
- |
|
536 |
- if ( num_grays < 2 )
|
|
537 |
- {
|
|
538 |
- grError = gr_err_bad_argument;
|
|
539 |
- return NULL;
|
|
540 |
- }
|
|
541 |
- |
|
542 |
- for ( ; sat < limit; sat++ )
|
|
543 |
- {
|
|
544 |
- if ( sat->count == num_grays )
|
|
545 |
- {
|
|
546 |
- gr_last_saturation = sat;
|
|
547 |
- return sat->table;
|
|
548 |
- }
|
|
549 |
- }
|
|
550 |
- |
|
551 |
- /* not found, simply create a new entry if there is room */
|
|
552 |
- if (gr_num_saturations < GR_MAX_SATURATIONS)
|
|
553 |
- {
|
|
554 |
- int i;
|
|
555 |
- byte* table;
|
|
556 |
- |
|
557 |
- table = (byte*)malloc( (size_t)( 3 * num_grays - 1 ) * sizeof ( byte ) );
|
|
558 |
- if (!table)
|
|
559 |
- return NULL;
|
|
560 |
- |
|
561 |
- sat->count = num_grays;
|
|
562 |
- sat->table = table;
|
|
563 |
- |
|
564 |
- for ( i = 0; i < num_grays; i++ )
|
|
565 |
- table[i] = (byte)i;
|
|
566 |
- |
|
567 |
- memset( table+num_grays, num_grays-1, 2*num_grays-1 );
|
|
568 |
- |
|
569 |
- gr_num_saturations++;
|
|
570 |
- gr_last_saturation = sat;
|
|
571 |
- return table;
|
|
572 |
- }
|
|
573 |
- grError = gr_err_saturation_overflow;
|
|
574 |
- return NULL;
|
|
575 |
- }
|
|
576 |
- |
|
577 |
- |
|
578 |
- |
|
579 |
- /*******************************************************************/
|
|
580 |
- /* */
|
|
581 |
- /* conversion tables */
|
|
582 |
- /* */
|
|
583 |
- /*******************************************************************/
|
|
584 |
- |
|
585 |
- typedef struct grConversion_
|
|
586 |
- {
|
|
587 |
- int target_grays;
|
|
588 |
- int source_grays;
|
|
589 |
- const byte* table;
|
|
590 |
- |
|
591 |
- } grConversion;
|
|
592 |
- |
|
593 |
- |
|
594 |
- |
|
595 |
- static
|
|
596 |
- const byte gr_gray5_to_gray17[5] = { 0, 4, 8, 12, 16 };
|
|
597 |
- |
|
598 |
- |
|
599 |
- static
|
|
600 |
- const byte gr_gray5_to_gray128[5] = { 0, 32, 64, 96, 127 };
|
|
601 |
- |
|
602 |
- |
|
603 |
- static
|
|
604 |
- const byte gr_gray17_to_gray128[17] =
|
|
605 |
- {
|
|
606 |
- 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 127
|
|
607 |
- };
|
|
608 |
- |
|
609 |
- static
|
|
610 |
- grConversion gr_conversions[ GR_MAX_CONVERSIONS ] =
|
|
611 |
- {
|
|
612 |
- { 17, 5, gr_gray5_to_gray17 },
|
|
613 |
- { 128, 5, gr_gray5_to_gray128 },
|
|
614 |
- { 128, 17, gr_gray17_to_gray128 }
|
|
615 |
- };
|
|
616 |
- |
|
617 |
- static
|
|
618 |
- int gr_num_conversions = 3;
|
|
619 |
- |
|
620 |
- static
|
|
621 |
- grConversion* gr_last_conversion = gr_conversions;
|
|
622 |
- |
|
623 |
- |
|
624 |
- static const byte*
|
|
625 |
- grGetConversion( int target_grays,
|
|
626 |
- int source_grays )
|
|
627 |
- {
|
|
628 |
- grConversion* conv = gr_conversions;
|
|
629 |
- grConversion* limit = conv + gr_num_conversions;
|
|
630 |
- |
|
631 |
- if ( target_grays < 2 || source_grays < 2 )
|
|
632 |
- {
|
|
633 |
- grError = gr_err_bad_argument;
|
|
634 |
- return NULL;
|
|
635 |
- }
|
|
636 |
- |
|
637 |
- /* otherwise, scan table */
|
|
638 |
- for ( ; conv < limit; conv++ )
|
|
639 |
- {
|
|
640 |
- if ( conv->target_grays == target_grays &&
|
|
641 |
- conv->source_grays == source_grays )
|
|
642 |
- {
|
|
643 |
- gr_last_conversion = conv;
|
|
644 |
- return conv->table;
|
|
645 |
- }
|
|
646 |
- }
|
|
647 |
- |
|
648 |
- /* not found, add a new conversion to the table */
|
|
649 |
- if (gr_num_conversions < GR_MAX_CONVERSIONS)
|
|
650 |
- {
|
|
651 |
- byte* table;
|
|
652 |
- int n;
|
|
653 |
- |
|
654 |
- table = (byte*)malloc( (size_t)source_grays * sizeof ( byte ) );
|
|
655 |
- if (!table)
|
|
656 |
- return NULL;
|
|
657 |
- |
|
658 |
- conv->target_grays = target_grays;
|
|
659 |
- conv->source_grays = source_grays;
|
|
660 |
- conv->table = table;
|
|
661 |
- |
|
662 |
- for ( n = 0; n < source_grays; n++ )
|
|
663 |
- table[n] = (byte)(n*(target_grays-1) / (source_grays-1));
|
|
664 |
- |
|
665 |
- gr_num_conversions++;
|
|
666 |
- gr_last_conversion = conv;
|
|
667 |
- return table;
|
|
668 |
- }
|
|
669 |
- grError = gr_err_conversion_overflow;
|
|
670 |
- return NULL;
|
|
671 |
- }
|
|
672 |
- |
|
673 |
- |
|
674 |
- |
|
675 |
- |
|
676 |
-/**************************************************************************/
|
|
677 |
-/* */
|
|
678 |
-/* <Function> blit_gray_to_gray */
|
|
679 |
-/* */
|
|
680 |
-/**************************************************************************/
|
|
681 |
- |
|
682 |
- static
|
|
683 |
- void blit_gray_to_gray( grBlitter* blit,
|
|
684 |
- const byte* saturation,
|
|
685 |
- const byte* conversion )
|
|
686 |
- {
|
|
687 |
- int y;
|
|
688 |
- unsigned char* read;
|
|
689 |
- unsigned char* write;
|
|
690 |
-#ifdef GR_CONFIG_GRAY_SKIP_WHITE
|
|
691 |
- int max = blit->source.grays - 1;
|
|
692 |
- int max2 = blit-target.grays - 1;
|
|
693 |
-#endif
|
|
694 |
- |
|
695 |
- read = blit->read + blit->xread;
|
|
696 |
- write = blit->write + blit->xwrite;
|
|
697 |
- |
|
698 |
- y = blit->height;
|
|
699 |
- do
|
|
700 |
- {
|
|
701 |
- unsigned char* _read = read;
|
|
702 |
- unsigned char* _write = write;
|
|
703 |
- int x = blit->width;
|
|
704 |
- |
|
705 |
- while (x > 0)
|
|
706 |
- {
|
|
707 |
-#ifdef GR_CONFIG_GRAY_SKIP_WHITE
|
|
708 |
- int val = *_read;
|
|
709 |
- |
|
710 |
- if (val)
|
|
711 |
- {
|
|
712 |
- if (val == max)
|
|
713 |
- *_write = (byte)max2;
|
|
714 |
- else
|
|
715 |
- *_write = saturation[ (int)*_write + conversion[ *_read ] ];
|
|
716 |
- }
|
|
717 |
-#else
|
|
718 |
- *_write = saturation[ (int)*_write + conversion[ *_read ] ];
|
|
719 |
-#endif
|
|
720 |
- _write++;
|
|
721 |
- _read++;
|
|
722 |
- x--;
|
|
723 |
- }
|
|
724 |
- |
|
725 |
- read += blit->read_line;
|
|
726 |
- write += blit->write_line;
|
|
727 |
- y--;
|
|
728 |
- }
|
|
729 |
- while (y > 0);
|
|
730 |
- }
|
|
731 |
- |
|
732 |
- |
|
733 |
-/**************************************************************************/
|
|
734 |
-/* */
|
|
735 |
-/* <Function> blit_gray_to_gray_simple */
|
|
736 |
-/* */
|
|
737 |
-/**************************************************************************/
|
|
738 |
- |
|
739 |
- static
|
|
740 |
- void blit_gray_to_gray_simple( grBlitter* blit,
|
|
741 |
- const byte* saturation )
|
|
742 |
- {
|
|
743 |
- int y;
|
|
744 |
- unsigned char* read;
|
|
745 |
- unsigned char* write;
|
|
746 |
-#ifdef GR_CONFIG_GRAY_SKIP_WHITE
|
|
747 |
- int max = blit->source.grays - 1;
|
|
748 |
-#endif
|
|
749 |
- |
|
750 |
- read = blit->read + blit->xread;
|
|
751 |
- write = blit->write + blit->xwrite;
|
|
752 |
- |
|
753 |
- y = blit->height;
|
|
754 |
- do
|
|
755 |
- {
|
|
756 |
- unsigned char* _read = read;
|
|
757 |
- unsigned char* _write = write;
|
|
758 |
- int x = blit->width;
|
|
759 |
- |
|
760 |
- while (x > 0)
|
|
761 |
- {
|
|
762 |
-#ifdef GR_CONFIG_GRAY_SKIP_WHITE
|
|
763 |
- int val = *_read;
|
|
764 |
- |
|
765 |
- if (val)
|
|
766 |
- {
|
|
767 |
- if (val == max)
|
|
768 |
- *_write = val;
|
|
769 |
- else
|
|
770 |
- *_write = saturation[ (int)*_write + *_read ];
|
|
771 |
- }
|
|
772 |
-#else
|
|
773 |
- *_write = saturation[ (int)*_write + *_read ];
|
|
774 |
-#endif
|
|
775 |
- _write++;
|
|
776 |
- _read++;
|
|
777 |
- x--;
|
|
778 |
- }
|
|
779 |
- |
|
780 |
- read += blit->read_line;
|
|
781 |
- write += blit->write_line;
|
|
782 |
- y--;
|
|
783 |
- }
|
|
784 |
- while (y > 0);
|
|
785 |
- }
|
|
786 |
- |
|
787 |
- |
|
788 |
- |
|
789 |
-#define compose_pixel_full( a, b, n0, n1, n2, max ) \
|
|
790 |
- do \
|
|
791 |
- { \
|
|
792 |
- int d, half = max >> 1; \
|
|
793 |
- \
|
|
794 |
- \
|
|
795 |
- d = (int)b.chroma[0] - a.chroma[0]; \
|
|
796 |
- a.chroma[0] += (unsigned char)((n0*d + half)/max); \
|
|
797 |
- \
|
|
798 |
- d = (int)b.chroma[1] - a.chroma[1]; \
|
|
799 |
- a.chroma[1] += (unsigned char)((n1*d + half)/max); \
|
|
800 |
- \
|
|
801 |
- d = (int)b.chroma[2] - a.chroma[2]; \
|
|
802 |
- a.chroma[2] += (unsigned char)((n2*d + half)/max); \
|
|
803 |
- } while ( 0 )
|
|
804 |
- |
|
805 |
-#define compose_pixel( a, b, n, max ) \
|
|
806 |
- compose_pixel_full( a, b, n, n, n, max )
|
|
807 |
- |
|
808 |
- |
|
809 |
-#define extract555( pixel, color ) \
|
|
810 |
- color.chroma[0] = (unsigned char)((pixel >> 10) & 0x1F); \
|
|
811 |
- color.chroma[1] = (unsigned char)((pixel >> 5) & 0x1F); \
|
|
812 |
- color.chroma[2] = (unsigned char)((pixel ) & 0x1F)
|
|
813 |
- |
|
814 |
- |
|
815 |
-#define extract565( pixel, color ) \
|
|
816 |
- color.chroma[0] = (unsigned char)((pixel >> 11) & 0x1F); \
|
|
817 |
- color.chroma[1] = (unsigned char)((pixel >> 5) & 0x3F); \
|
|
818 |
- color.chroma[2] = (unsigned char)((pixel ) & 0x1F)
|
|
819 |
- |
|
820 |
- |
|
821 |
-#define inject555( color ) \
|
|
822 |
- (unsigned short)( ( color.chroma[0] << 10 ) | \
|
|
823 |
- ( color.chroma[1] << 5 ) | \
|
|
824 |
- color.chroma[2] )
|
|
825 |
- |
|
826 |
- |
|
827 |
-#define inject565( color ) \
|
|
828 |
- (unsigned short)( ( color.chroma[0] << 11 ) | \
|
|
829 |
- ( color.chroma[1] << 5 ) | \
|
|
830 |
- color.chroma[2] )
|
|
831 |
- |
|
832 |
- |
|
833 |
-/**************************************************************************/
|
|
834 |
-/* */
|
|
835 |
-/* <Function> blit_gray_to_555 */
|
|
836 |
-/* */
|
|
837 |
-/**************************************************************************/
|
|
838 |
- |
|
839 |
-#ifdef GRAY8
|
|
840 |
- static
|
|
841 |
- void blit_gray8_to_555( grBlitter* blit,
|
|
842 |
- grColor color )
|
|
843 |
- {
|
|
844 |
- int y;
|
|
845 |
- int sr = color.value & 0x7C00;
|
|
846 |
- int sg = color.value & 0x03E0;
|
|
847 |
- int sb = color.value & 0x001F;
|
|
848 |
- unsigned char* read;
|
|
849 |
- unsigned char* write;
|
|
850 |
- |
|
851 |
- read = blit->read + blit->xread;
|
|
852 |
- write = blit->write + 2*blit->xwrite;
|
|
853 |
- |
|
854 |
- y = blit->height;
|
|
855 |
- do
|
|
856 |
- {
|
|
857 |
- unsigned char* _read = read;
|
|
858 |
- unsigned short* _write = (unsigned short*)write;
|
|
859 |
- int x = blit->width;
|
|
860 |
- |
|
861 |
- while (x > 0)
|
|
862 |
- {
|
|
863 |
- unsigned char val = *_read;
|
|
864 |
- |
|
865 |
- if (val)
|
|
866 |
- {
|
|
867 |
- if (val >= 254 )
|
|
868 |
- *_write = (unsigned short)( sr | sg | sb );
|
|
869 |
- else if ( val >= 2 )
|
|
870 |
- {
|
|
871 |
- /* compose gray value */
|
|
872 |
- int pix = (int)*_write;
|
|
873 |
- int dr = pix & 0x7C00;
|
|
874 |
- int dg = pix & 0x03E0;
|
|
875 |
- int db = pix & 0x001F;
|
|
876 |
- |
|
877 |
- dr += ((sr-dr)*val) >> 8;
|
|
878 |
- dr &= 0x7C00;
|
|
879 |
- |
|
880 |
- dg += ((sg-dg)*val) >> 8;
|
|
881 |
- dg &= 0x03E0;
|
|
882 |
- |
|
883 |
- db += ((sb-db)*val) >> 8;
|
|
884 |
- db &= 0x001F;
|
|
885 |
- |
|
886 |
- *_write = (unsigned short)( dr | dg | db );
|
|
887 |
- }
|
|
888 |
- }
|
|
889 |
- _write ++;
|
|
890 |
- _read ++;
|
|
891 |
- x--;
|
|
892 |
- }
|
|
893 |
- |
|
894 |
- read += blit->read_line;
|
|
895 |
- write += blit->write_line;
|
|
896 |
- y--;
|
|
897 |
- }
|
|
898 |
- while (y > 0);
|
|
899 |
- |
|
900 |
- }
|
|
901 |
-#endif /* GRAY8 */
|
|
902 |
- |
|
903 |
- static
|
|
904 |
- void blit_gray_to_555( grBlitter* blit,
|
|
905 |
- grColor color,
|
|
906 |
- int max )
|
|
907 |
- {
|
|
908 |
- int y;
|
|
909 |
- unsigned char* read;
|
|
910 |
- unsigned char* write;
|
|
911 |
- |
|
912 |
- read = blit->read + blit->xread;
|
|
913 |
- write = blit->write + 2*blit->xwrite;
|
|
914 |
- |
|
915 |
- /* scale down R:G:B triplet */
|
|
916 |
- color.chroma[0] >>= 3;
|
|
917 |
- color.chroma[1] >>= 3;
|
|
918 |
- color.chroma[2] >>= 3;
|
|
919 |
- |
|
920 |
- y = blit->height;
|
|
921 |
- do
|
|
922 |
- {
|
|
923 |
- unsigned char* _read = read;
|
|
924 |
- unsigned short* _write = (unsigned short*)write;
|
|
925 |
- int x = blit->width;
|
|
926 |
- |
|
927 |
- while (x > 0)
|
|
928 |
- {
|
|
929 |
- int val = *_read;
|
|
930 |
- |
|
931 |
- if (val)
|
|
932 |
- {
|
|
933 |
- if (val == max)
|
|
934 |
- *_write = inject555( color );
|
|
935 |
- else
|
|
936 |
- {
|
|
937 |
- /* compose gray value */
|
|
938 |
- unsigned short pix16 = *_write;
|
|
939 |
- grColor pix;
|
|
940 |
- |
|
941 |
- extract555( pix16, pix );
|
|
942 |
- |
|
943 |
- compose_pixel( pix, color, val, max );
|
|
944 |
- *_write = inject555( pix );
|
|
945 |
- }
|
|
946 |
- }
|
|
947 |
- _write ++;
|
|
948 |
- _read ++;
|
|
949 |
- x--;
|
|
950 |
- }
|
|
951 |
- |
|
952 |
- read += blit->read_line;
|
|
953 |
- write += blit->write_line;
|
|
954 |
- y--;
|
|
955 |
- }
|
|
956 |
- while (y > 0);
|
|
957 |
- }
|
|
958 |
- |
|
959 |
- |
|
960 |
-/**************************************************************************/
|
|
961 |
-/* */
|
|
962 |
-/* <Function> blit_gray_to_565 */
|
|
963 |
-/* */
|
|
964 |
-/**************************************************************************/
|
|
965 |
- |
|
966 |
-#ifdef GRAY8
|
|
967 |
- static
|
|
968 |
- void blit_gray8_to_565( grBlitter* blit,
|
|
969 |
- grColor color )
|
|
970 |
- {
|
|
971 |
- int y;
|
|
972 |
- int sr = color.value & 0xF800;
|
|
973 |
- int sg = color.value & 0x07E0;
|
|
974 |
- int sb = color.value & 0x001F;
|
|
975 |
- unsigned char* read;
|
|
976 |
- unsigned char* write;
|
|
977 |
- |
|
978 |
- read = blit->read + blit->xread;
|
|
979 |
- write = blit->write + 2*blit->xwrite;
|
|
980 |
- |
|
981 |
- y = blit->height;
|
|
982 |
- do
|
|
983 |
- {
|
|
984 |
- unsigned char* _read = read;
|
|
985 |
- unsigned short* _write = (unsigned short*)write;
|
|
986 |
- int x = blit->width;
|
|
987 |
- |
|
988 |
- while (x > 0)
|
|
989 |
- {
|
|
990 |
- unsigned char val = *_read;
|
|
991 |
- |
|
992 |
- if (val)
|
|
993 |
- {
|
|
994 |
- if (val >= 254 )
|
|
995 |
- *_write = (unsigned short)( sr | sg | sb );
|
|
996 |
- else if ( val >= 2 )
|
|
997 |
- {
|
|
998 |
- /* compose gray value */
|
|
999 |
- int pix = (int)*_write;
|
|
1000 |
- int dr = pix & 0xF800;
|
|
1001 |
- int dg = pix & 0x07E0;
|
|
1002 |
- int db = pix & 0x001F;
|
|
1003 |
- |
|
1004 |
- dr += ((sr-dr)*val) >> 8;
|
|
1005 |
- dr &= 0xF800;
|
|
1006 |
- |
|
1007 |
- dg += ((sg-dg)*val) >> 8;
|
|
1008 |
- dg &= 0x07E0;
|
|
1009 |
- |
|
1010 |
- db += ((sb-db)*val) >> 8;
|
|
1011 |
- db &= 0x001F;
|
|
1012 |
- |
|
1013 |
- *_write = (unsigned short)( dr | dg | db );
|
|
1014 |
- }
|
|
1015 |
- }
|
|
1016 |
- _write ++;
|
|
1017 |
- _read ++;
|
|
1018 |
- x--;
|
|
1019 |
- }
|
|
1020 |
- |
|
1021 |
- read += blit->read_line;
|
|
1022 |
- write += blit->write_line;
|
|
1023 |
- y--;
|
|
1024 |
- }
|
|
1025 |
- while (y > 0);
|
|
1026 |
- }
|
|
1027 |
-#endif
|
|
1028 |
- |
|
1029 |
- static
|
|
1030 |
- void blit_gray_to_565( grBlitter* blit,
|
|
1031 |
- grColor color,
|
|
1032 |
- int max )
|
|
1033 |
- {
|
|
1034 |
- int y;
|
|
1035 |
- unsigned char* read;
|
|
1036 |
- unsigned char* write;
|
|
1037 |
- |
|
1038 |
- read = blit->read + blit->xread;
|
|
1039 |
- write = blit->write + 2*blit->xwrite;
|
|
1040 |
- |
|
1041 |
- /* scale down R:G:B triplet */
|
|
1042 |
- color.chroma[0] >>= 3;
|
|
1043 |
- color.chroma[1] >>= 2;
|
|
1044 |
- color.chroma[2] >>= 3;
|
|
1045 |
- |
|
1046 |
- y = blit->height;
|
|
1047 |
- do
|
|
1048 |
- {
|
|
1049 |
- unsigned char* _read = read;
|
|
1050 |
- unsigned short* _write = (unsigned short*)write;
|
|
1051 |
- int x = blit->width;
|
|
1052 |
- |
|
1053 |
- while (x > 0)
|
|
1054 |
- {
|
|
1055 |
- int val = *_read;
|
|
1056 |
- |
|
1057 |
- if (val)
|
|
1058 |
- {
|
|
1059 |
- if (val == max)
|
|
1060 |
- *_write = inject565( color );
|
|
1061 |
- else
|
|
1062 |
- {
|
|
1063 |
- /* compose gray value */
|
|
1064 |
- unsigned short pix16 = *_write;
|
|
1065 |
- grColor pix;
|
|
1066 |
- |
|
1067 |
- extract565( pix16, pix );
|
|
1068 |
- |
|
1069 |
- compose_pixel( pix, color, val, max );
|
|
1070 |
- *_write = inject565( pix );
|
|
1071 |
- }
|
|
1072 |
- }
|
|
1073 |
- _write ++;
|
|
1074 |
- _read ++;
|
|
1075 |
- x--;
|
|
1076 |
- }
|
|
1077 |
- |
|
1078 |
- read += blit->read_line;
|
|
1079 |
- write += blit->write_line;
|
|
1080 |
- y--;
|
|
1081 |
- }
|
|
1082 |
- while (y > 0);
|
|
1083 |
- }
|
|
1084 |
- |
|
1085 |
- |
|
1086 |
-/**************************************************************************/
|
|
1087 |
-/* */
|
|
1088 |
-/* <Function> blit_gray_to_24 */
|
|
1089 |
-/* */
|
|
1090 |
-/**************************************************************************/
|
|
1091 |
- |
|
1092 |
-#ifdef GRAY8
|
|
1093 |
- static void
|
|
1094 |
- blit_gray8_to_24( grBlitter* blit,
|
|
1095 |
- grColor color )
|
|
1096 |
- {
|
|
1097 |
- int y;
|
|
1098 |
- int sr = color.chroma[0];
|
|
1099 |
- int sg = color.chroma[1];
|
|
1100 |
- int sb = color.chroma[2];
|
|
1101 |
- unsigned char* read;
|
|
1102 |
- unsigned char* write;
|
|
1103 |
- |
|
1104 |
- read = blit->read + blit->xread;
|
|
1105 |
- write = blit->write + 3*blit->xwrite;
|
|
1106 |
- |
|
1107 |
- y = blit->height;
|
|
1108 |
- do
|
|
1109 |
- {
|
|
1110 |
- unsigned char* _read = read;
|
|
1111 |
- unsigned char* _write = write;
|
|
1112 |
- int x = blit->width;
|
|
1113 |
- |
|
1114 |
- while (x > 0)
|
|
1115 |
- {
|
|
1116 |
- unsigned char val = *_read;
|
|
1117 |
- |
|
1118 |
- if (val)
|
|
1119 |
- {
|
|
1120 |
- if (val >= 254)
|
|
1121 |
- {
|
|
1122 |
- _write[0] = (unsigned char)sr;
|
|
1123 |
- _write[1] = (unsigned char)sg;
|
|
1124 |
- _write[2] = (unsigned char)sb;
|
|
1125 |
- }
|
|
1126 |
- else if ( val >= 2 )
|
|
1127 |
- {
|
|
1128 |
- int dr = _write[0];
|
|
1129 |
- int dg = _write[1];
|
|
1130 |
- int db = _write[2];
|
|
1131 |
- |
|
1132 |
- dr += ((sr-dr)*val) >> 8;
|
|
1133 |
- dg += ((sg-dg)*val) >> 8;
|
|
1134 |
- db += ((sb-db)*val) >> 8;
|
|
1135 |
- |
|
1136 |
- _write[0] = (unsigned char)dr;
|
|
1137 |
- _write[1] = (unsigned char)dg;
|
|
1138 |
- _write[2] = (unsigned char)db;
|
|
1139 |
- }
|
|
1140 |
- }
|
|
1141 |
- _write += 3;
|
|
1142 |
- _read ++;
|
|
1143 |
- x--;
|
|
1144 |
- }
|
|
1145 |
- |
|
1146 |
- read += blit->read_line;
|
|
1147 |
- write += blit->write_line;
|
|
1148 |
- y--;
|
|
1149 |
- }
|
|
1150 |
- while (y > 0);
|
|
1151 |
- }
|
|
1152 |
-#endif /* GRAY8 */
|
|
1153 |
- |
|
1154 |
- |
|
1155 |
- static
|
|
1156 |
- void blit_gray_to_24( grBlitter* blit,
|
|
1157 |
- grColor color,
|
|
1158 |
- int max )
|
|
1159 |
- {
|
|
1160 |
- int y;
|
|
1161 |
- unsigned char* read;
|
|
1162 |
- unsigned char* write;
|
|
1163 |
- |
|
1164 |
- read = blit->read + blit->xread;
|
|
1165 |
- write = blit->write + 3*blit->xwrite;
|
|
1166 |
- |
|
1167 |
- y = blit->height;
|
|
1168 |
- do
|
|
1169 |
- {
|
|
1170 |
- unsigned char* _read = read;
|
|
1171 |
- unsigned char* _write = write;
|
|
1172 |
- int x = blit->width;
|
|
1173 |
- |
|
1174 |
- while (x > 0)
|
|
1175 |
- {
|
|
1176 |
- int val = *_read;
|
|
1177 |
- |
|
1178 |
- if (val)
|
|
1179 |
- {
|
|
1180 |
- if (val == max)
|
|
1181 |
- {
|
|
1182 |
- _write[0] = color.chroma[0];
|
|
1183 |
- _write[1] = color.chroma[1];
|
|
1184 |
- _write[2] = color.chroma[2];
|
|
1185 |
- }
|
|
1186 |
- else
|
|
1187 |
- {
|
|
1188 |
- /* compose gray value */
|
|
1189 |
- grColor pix;
|
|
1190 |
- |
|
1191 |
- pix.chroma[0] = _write[0];
|
|
1192 |
- pix.chroma[1] = _write[1];
|
|
1193 |
- pix.chroma[2] = _write[2];
|
|
1194 |
- |
|
1195 |
- compose_pixel( pix, color, val, max );
|
|
1196 |
- |
|
1197 |
- _write[0] = pix.chroma[0];
|
|
1198 |
- _write[1] = pix.chroma[1];
|
|
1199 |
- _write[2] = pix.chroma[2];
|
|
1200 |
- }
|
|
1201 |
- }
|
|
1202 |
- _write += 3;
|
|
1203 |
- _read ++;
|
|
1204 |
- x--;
|
|
1205 |
- }
|
|
1206 |
- |
|
1207 |
- read += blit->read_line;
|
|
1208 |
- write += blit->write_line;
|
|
1209 |
- y--;
|
|
1210 |
- }
|
|
1211 |
- while (y > 0);
|
|
1212 |
- }
|
|
1213 |
- |
|
1214 |
- |
|
1215 |
-/**************************************************************************/
|
|
1216 |
-/* */
|
|
1217 |
-/* <Function> blit_gray_to_32 */
|
|
1218 |
-/* */
|
|
1219 |
-/**************************************************************************/
|
|
1220 |
- |
|
1221 |
- static
|
|
1222 |
- void blit_gray_to_32( grBlitter* blit,
|
|
1223 |
- grColor color,
|
|
1224 |
- int max )
|
|
1225 |
- {
|
|
1226 |
- int y;
|
|
1227 |
- unsigned char* read;
|
|
1228 |
- unsigned char* write;
|
|
1229 |
- |
|
1230 |
- read = blit->read + blit->xread;
|
|
1231 |
- write = blit->write + 4*blit->xwrite;
|
|
1232 |
- |
|
1233 |
- y = blit->height;
|
|
1234 |
- do
|
|
1235 |
- {
|
|
1236 |
- unsigned char* _read = read;
|
|
1237 |
- unsigned char* _write = write;
|
|
1238 |
- int x = blit->width;
|
|
1239 |
- |
|
1240 |
- while (x > 0)
|
|
1241 |
- {
|
|
1242 |
- int val = *_read;
|
|
1243 |
- |
|
1244 |
- if (val)
|
|
1245 |
- {
|
|
1246 |
- if (val == max)
|
|
1247 |
- {
|
|
1248 |
- _write[0] = color.chroma[0];
|
|
1249 |
- _write[1] = color.chroma[1];
|
|
1250 |
- _write[2] = color.chroma[2];
|
|
1251 |
- _write[3] = color.chroma[3];
|
|
1252 |
- }
|
|
1253 |
- else
|
|
1254 |
- {
|
|
1255 |
- /* compose gray value */
|
|
1256 |
- grColor pix;
|
|
1257 |
- |
|
1258 |
- pix.chroma[0] = _write[0];
|
|
1259 |
- pix.chroma[1] = _write[1];
|
|
1260 |
- pix.chroma[2] = _write[2];
|
|
1261 |
- |
|
1262 |
- compose_pixel( pix, color, val, max );
|
|
1263 |
- |
|
1264 |
- _write[0] = pix.chroma[0];
|
|
1265 |
- _write[1] = pix.chroma[1];
|
|
1266 |
- _write[2] = pix.chroma[2];
|
|
1267 |
- }
|
|
1268 |
- }
|
|
1269 |
- _write += 4;
|
|
1270 |
- _read ++;
|
|
1271 |
- x--;
|
|
1272 |
- }
|
|
1273 |
- |
|
1274 |
- read += blit->read_line;
|
|
1275 |
- write += blit->write_line;
|
|
1276 |
- y--;
|
|
1277 |
- }
|
|
1278 |
- while (y > 0);
|
|
1279 |
- }
|
|
1280 |
- |
|
1281 |
- |
|
1282 |
- static
|
|
1283 |
- void blit_gray8_to_32( grBlitter* blit,
|
|
1284 |
- grColor color )
|
|
1285 |
- {
|
|
1286 |
- blit_gray_to_32( blit, color, 255 );
|
|
1287 |
- }
|
|
1288 |
- |
|
1289 |
- |
|
1290 |
-/**************************************************************************/
|
|
1291 |
-/* */
|
|
1292 |
-/* <Function> blit_lcd_to_24 */
|
|
1293 |
-/* */
|
|
1294 |
-/**************************************************************************/
|
|
1295 |
- |
|
1296 |
-#ifdef GRAY8
|
|
1297 |
- static void
|
|
1298 |
- blit_lcd8_to_24( grBlitter* blit,
|
|
1299 |
- grColor color )
|
|
1300 |
- {
|
|
1301 |
- int y;
|
|
1302 |
- int sr = color.chroma[0];
|
|
1303 |
- int sg = color.chroma[1];
|
|
1304 |
- int sb = color.chroma[2];
|
|
1305 |
- unsigned char* read;
|
|
1306 |
- unsigned char* write;
|
|
1307 |
- |
|
1308 |
- read = blit->read + 3*blit->xread;
|
|
1309 |
- write = blit->write + 3*blit->xwrite;
|
|
1310 |
- |
|
1311 |
- y = blit->height;
|
|
1312 |
- do
|
|
1313 |
- {
|
|
1314 |
- unsigned char* _read = read;
|
|
1315 |
- unsigned char* _write = write;
|
|
1316 |
- int x = blit->width;
|
|
1317 |
- |
|
1318 |
- while (x > 0)
|
|
1319 |
- {
|
|
1320 |
- int val0 = _read[0];
|
|
1321 |
- int val1 = _read[1];
|
|
1322 |
- int val2 = _read[2];
|
|
1323 |
- |
|
1324 |
- if ( val0 | val1 | val2 )
|
|
1325 |
- {
|
|
1326 |
- if ( val0 == val1 &&
|
|
1327 |
- val0 == val2 &&
|
|
1328 |
- val0 == 255 )
|
|
1329 |
- {
|
|
1330 |
- _write[0] = (unsigned char)sr;
|
|
1331 |
- _write[1] = (unsigned char)sg;
|
|
1332 |
- _write[2] = (unsigned char)sb;
|
|
1333 |
- }
|
|
1334 |
- else
|
|
1335 |
- {
|
|
1336 |
- /* compose gray value */
|
|
1337 |
- int dr, dg, db;
|
|
1338 |
- |
|
1339 |
- dr = _write[0];
|
|
1340 |
- dr += (sr-dr)*val0 >> 8;
|
|
1341 |
- |
|
1342 |
- dg = _write[1];
|
|
1343 |
- dg += (sg-dg)*val1 >> 8;
|
|
1344 |
- |
|
1345 |
- db = _write[2];
|
|
1346 |
- db += (sb-db)*val2 >> 8;
|
|
1347 |
- |
|
1348 |
- _write[0] = (unsigned char)dr;
|
|
1349 |
- _write[1] = (unsigned char)dg;
|
|
1350 |
- _write[2] = (unsigned char)db;
|
|
1351 |
- }
|
|
1352 |
- }
|
|
1353 |
- _write += 3;
|
|
1354 |
- _read += 3;
|
|
1355 |
- x--;
|
|
1356 |
- }
|
|
1357 |
- |
|
1358 |
- read += blit->read_line;
|
|
1359 |
- write += blit->write_line;
|
|
1360 |
- y--;
|
|
1361 |
- }
|
|
1362 |
- while (y > 0);
|
|
1363 |
- }
|
|
1364 |
-#endif /* GRAY8 */
|
|
1365 |
- |
|
1366 |
- static void
|
|
1367 |
- blit_lcd_to_24( grBlitter* blit,
|
|
1368 |
- grColor color,
|
|
1369 |
- int max )
|
|
1370 |
- {
|
|
1371 |
- int y;
|
|
1372 |
- unsigned char* read;
|
|
1373 |
- unsigned char* write;
|
|
1374 |
- |
|
1375 |
- read = blit->read + 3*blit->xread;
|
|
1376 |
- write = blit->write + 3*blit->xwrite;
|
|
1377 |
- |
|
1378 |
- y = blit->height;
|
|
1379 |
- do
|
|
1380 |
- {
|
|
1381 |
- unsigned char* _read = read;
|
|
1382 |
- unsigned char* _write = write;
|
|
1383 |
- int x = blit->width;
|
|
1384 |
- |
|
1385 |
- while (x > 0)
|
|
1386 |
- {
|
|
1387 |
- int val0 = _read[0];
|
|
1388 |
- int val1 = _read[1];
|
|
1389 |
- int val2 = _read[2];
|
|
1390 |
- |
|
1391 |
- if ( val0 | val1 | val2 )
|
|
1392 |
- {
|
|
1393 |
- if ( val0 == val1 &&
|
|
1394 |
- val0 == val2 &&
|
|
1395 |
- val0 == max )
|
|
1396 |
- {
|
|
1397 |
- _write[0] = color.chroma[0];
|
|
1398 |
- _write[1] = color.chroma[1];
|
|
1399 |
- _write[2] = color.chroma[2];
|
|
1400 |
- }
|
|
1401 |
- else
|
|
1402 |
- {
|
|
1403 |
- /* compose gray value */
|
|
1404 |
- grColor pix;
|
|
1405 |
- |
|
1406 |
- pix.chroma[0] = _write[0];
|
|
1407 |
- pix.chroma[1] = _write[1];
|
|
1408 |
- pix.chroma[2] = _write[2];
|
|
1409 |
- |
|
1410 |
- compose_pixel_full( pix, color, val0, val1, val2, max );
|
|
1411 |
- |
|
1412 |
- _write[0] = pix.chroma[0];
|
|
1413 |
- _write[1] = pix.chroma[1];
|
|
1414 |
- _write[2] = pix.chroma[2];
|
|
1415 |
- }
|
|
1416 |
- }
|
|
1417 |
- _write += 3;
|
|
1418 |
- _read += 3;
|
|
1419 |
- x--;
|
|
1420 |
- }
|
|
1421 |
- |
|
1422 |
- read += blit->read_line;
|
|
1423 |
- write += blit->write_line;
|
|
1424 |
- y--;
|
|
1425 |
- }
|
|
1426 |
- while (y > 0);
|
|
1427 |
- }
|
|
1428 |
- |
|
1429 |
- |
|
1430 |
-#ifdef GRAY8
|
|
1431 |
- static void
|
|
1432 |
- blit_lcd28_to_24( grBlitter* blit,
|
|
1433 |
- grColor color )
|
|
1434 |
- {
|
|
1435 |
- int y;
|
|
1436 |
- int sr = color.chroma[0];
|
|
1437 |
- int sg = color.chroma[1];
|
|
1438 |
- int sb = color.chroma[2];
|
|
1439 |
- unsigned char* read;
|
|
1440 |
- unsigned char* write;
|
|
1441 |
- |
|
1442 |
- read = blit->read + 3*blit->xread;
|
|
1443 |
- write = blit->write + 3*blit->xwrite;
|
|
1444 |
- |
|
1445 |
- y = blit->height;
|
|
1446 |
- do
|
|
1447 |
- {
|
|
1448 |
- unsigned char* _read = read;
|
|
1449 |
- unsigned char* _write = write;
|
|
1450 |
- int x = blit->width;
|
|
1451 |
- |
|
1452 |
- while (x > 0)
|
|
1453 |
- {
|
|
1454 |
- int val0 = _read[2];
|
|
1455 |
- int val1 = _read[1];
|
|
1456 |
- int val2 = _read[0];
|
|
1457 |
- |
|
1458 |
- if ( val0 | val1 | val2 )
|
|
1459 |
- {
|
|
1460 |
- if ( val0 == val1 &&
|
|
1461 |
- val0 == val2 &&
|
|
1462 |
- val0 == 255 )
|
|
1463 |
- {
|
|
1464 |
- _write[0] = (unsigned char)sr;
|
|
1465 |
- _write[1] = (unsigned char)sg;
|
|
1466 |
- _write[2] = (unsigned char)sb;
|
|
1467 |
- }
|
|
1468 |
- else
|
|
1469 |
- {
|
|
1470 |
- /* compose gray value */
|
|
1471 |
- int dr, dg, db;
|
|
1472 |
- |
|
1473 |
- dr = _write[0];
|
|
1474 |
- dr += (sr-dr)*val0 >> 8;
|
|
1475 |
- |
|
1476 |
- dg = _write[1];
|
|
1477 |
- dg += (sg-dg)*val1 >> 8;
|
|
1478 |
- |
|
1479 |
- db = _write[2];
|
|
1480 |
- db += (sb-db)*val2 >> 8;
|
|
1481 |
- |
|
1482 |
- _write[0] = (unsigned char)dr;
|
|
1483 |
- _write[1] = (unsigned char)dg;
|
|
1484 |
- _write[2] = (unsigned char)db;
|
|
1485 |
- }
|
|
1486 |
- }
|
|
1487 |
- _write += 3;
|
|
1488 |
- _read += 3;
|
|
1489 |
- x--;
|
|
1490 |
- }
|
|
1491 |
- |
|
1492 |
- read += blit->read_line;
|
|
1493 |
- write += blit->write_line;
|
|
1494 |
- y--;
|
|
1495 |
- }
|
|
1496 |
- while (y > 0);
|
|
1497 |
- }
|
|
1498 |
-#endif /* GRAY8 */
|
|
1499 |
- |
|
1500 |
- static void
|
|
1501 |
- blit_lcd2_to_24( grBlitter* blit,
|
|
1502 |
- grColor color,
|
|
1503 |
- int max )
|
|
1504 |
- {
|
|
1505 |
- int y;
|
|
1506 |
- unsigned char* read;
|
|
1507 |
- unsigned char* write;
|
|
1508 |
- |
|
1509 |
- read = blit->read + 3*blit->xread;
|
|
1510 |
- write = blit->write + 3*blit->xwrite;
|
|
1511 |
- |
|
1512 |
- y = blit->height;
|
|
1513 |
- do
|
|
1514 |
- {
|
|
1515 |
- unsigned char* _read = read;
|
|
1516 |
- unsigned char* _write = write;
|
|
1517 |
- int x = blit->width;
|
|
1518 |
- |
|
1519 |
- while (x > 0)
|
|
1520 |
- {
|
|
1521 |
- int val0 = _read[2];
|
|
1522 |
- int val1 = _read[1];
|
|
1523 |
- int val2 = _read[0];
|
|
1524 |
- |
|
1525 |
- if ( val0 | val1 | val2 )
|
|
1526 |
- {
|
|
1527 |
- if ( val0 == val1 &&
|
|
1528 |
- val0 == val2 &&
|
|
1529 |
- val0 == max )
|
|
1530 |
- {
|
|
1531 |
- _write[0] = color.chroma[0];
|
|
1532 |
- _write[1] = color.chroma[1];
|
|
1533 |
- _write[2] = color.chroma[2];
|
|
1534 |
- }
|
|
1535 |
- else
|
|
1536 |
- {
|
|
1537 |
- /* compose gray value */
|
|
1538 |
- grColor pix;
|
|
1539 |
- |
|
1540 |
- pix.chroma[0] = _write[0];
|
|
1541 |
- pix.chroma[1] = _write[1];
|
|
1542 |
- pix.chroma[2] = _write[2];
|
|
1543 |
- |
|
1544 |
- compose_pixel_full( pix, color, val0, val1, val2, max );
|
|
1545 |
- |
|
1546 |
- _write[0] = pix.chroma[0];
|
|
1547 |
- _write[1] = pix.chroma[1];
|
|
1548 |
- _write[2] = pix.chroma[2];
|
|
1549 |
- }
|
|
1550 |
- }
|
|
1551 |
- _write += 3;
|
|
1552 |
- _read += 3;
|
|
1553 |
- x--;
|
|
1554 |
- }
|
|
1555 |
- |
|
1556 |
- read += blit->read_line;
|
|
1557 |
- write += blit->write_line;
|
|
1558 |
- y--;
|
|
1559 |
- }
|
|
1560 |
- while (y > 0);
|
|
1561 |
- }
|
|
1562 |
- |
|
1563 |
- |
|
1564 |
-/**************************************************************************/
|
|
1565 |
-/* */
|
|
1566 |
-/* <Function> blit_lcdv_to_24 */
|
|
1567 |
-/* */
|
|
1568 |
-/**************************************************************************/
|
|
1569 |
- |
|
1570 |
- static void
|
|
1571 |
- blit_lcdv_to_24( grBlitter* blit,
|
|
1572 |
- grColor color,
|
|
1573 |
- int max )
|
|
1574 |
- {
|
|
1575 |
- int y;
|
|
1576 |
- unsigned char* read;
|
|
1577 |
- unsigned char* write;
|
|
1578 |
- long line;
|
|
1579 |
- |
|
1580 |
- read = blit->read + blit->xread;
|
|
1581 |
- write = blit->write + 3*blit->xwrite;
|
|
1582 |
- line = blit->read_line;
|
|
1583 |
- |
|
1584 |
- y = blit->height;
|
|
1585 |
- do
|
|
1586 |
- {
|
|
1587 |
- unsigned char* _read = read;
|
|
1588 |
- unsigned char* _write = write;
|
|
1589 |
- int x = blit->width;
|
|
1590 |
- |
|
1591 |
- while (x > 0)
|
|
1592 |
- {
|
|
1593 |
- int val0 = _read[0*line];
|
|
1594 |
- int val1 = _read[1*line];
|
|
1595 |
- int val2 = _read[2*line];
|
|
1596 |
- |
|
1597 |
- if ( val0 | val1 | val2 )
|
|
1598 |
- {
|
|
1599 |
- if ( val0 == val1 &&
|
|
1600 |
- val0 == val2 &&
|
|
1601 |
- val0 == max )
|
|
1602 |
- {
|
|
1603 |
- _write[0] = color.chroma[0];
|
|
1604 |
- _write[1] = color.chroma[1];
|
|
1605 |
- _write[2] = color.chroma[2];
|
|
1606 |
- }
|
|
1607 |
- else
|
|
1608 |
- {
|
|
1609 |
- /* compose gray value */
|
|
1610 |
- grColor pix;
|
|
1611 |
- |
|
1612 |
- pix.chroma[0] = _write[0];
|
|
1613 |
- pix.chroma[1] = _write[1];
|
|
1614 |
- pix.chroma[2] = _write[2];
|
|
1615 |
- |
|
1616 |
- compose_pixel_full( pix, color, val0, val1, val2, max );
|
|
1617 |
- |
|
1618 |
- _write[0] = pix.chroma[0];
|
|
1619 |
- _write[1] = pix.chroma[1];
|
|
1620 |
- _write[2] = pix.chroma[2];
|
|
1621 |
- }
|
|
1622 |
- }
|
|
1623 |
- _write += 3;
|
|
1624 |
- _read += 1;
|
|
1625 |
- x--;
|
|
1626 |
- }
|
|
1627 |
- |
|
1628 |
- read += 3*line;
|
|
1629 |
- write += blit->write_line;
|
|
1630 |
- y--;
|
|
1631 |
- }
|
|
1632 |
- while (y > 0);
|
|
1633 |
- }
|
|
1634 |
- |
|
1635 |
- |
|
1636 |
- static void
|
|
1637 |
- blit_lcdv2_to_24( grBlitter* blit,
|
|
1638 |
- grColor color,
|
|
1639 |
- int max )
|
|
1640 |
- {
|
|
1641 |
- int y;
|
|
1642 |
- unsigned char* read;
|
|
1643 |
- unsigned char* write;
|
|
1644 |
- long line;
|
|
1645 |
- |
|
1646 |
- read = blit->read + blit->xread;
|
|
1647 |
- write = blit->write + 3*blit->xwrite;
|
|
1648 |
- line = blit->read_line;
|
|
1649 |
- |
|
1650 |
- y = blit->height;
|
|
1651 |
- do
|
|
1652 |
- {
|
|
1653 |
- unsigned char* _read = read;
|
|
1654 |
- unsigned char* _write = write;
|
|
1655 |
- int x = blit->width;
|
|
1656 |
- |
|
1657 |
- while (x > 0)
|
|
1658 |
- {
|
|
1659 |
- int val0 = _read[2*line];
|
|
1660 |
- int val1 = _read[1*line];
|
|
1661 |
- int val2 = _read[0*line];
|
|
1662 |
- |
|
1663 |
- if ( val0 | val1 | val2 )
|
|
1664 |
- {
|
|
1665 |
- if ( val0 == val1 &&
|
|
1666 |
- val0 == val2 &&
|
|
1667 |
- val0 == max )
|
|
1668 |
- {
|
|
1669 |
- _write[0] = color.chroma[0];
|
|
1670 |
- _write[1] = color.chroma[1];
|
|
1671 |
- _write[2] = color.chroma[2];
|
|
1672 |
- }
|
|
1673 |
- else
|
|
1674 |
- {
|
|
1675 |
- /* compose gray value */
|
|
1676 |
- grColor pix;
|
|
1677 |
- |
|
1678 |
- pix.chroma[0] = _write[0];
|
|
1679 |
- pix.chroma[1] = _write[1];
|
|
1680 |
- pix.chroma[2] = _write[2];
|
|
1681 |
- |
|
1682 |
- compose_pixel_full( pix, color, val0, val1, val2, max );
|
|
1683 |
- |
|
1684 |
- _write[0] = pix.chroma[0];
|
|
1685 |
- _write[1] = pix.chroma[1];
|
|
1686 |
- _write[2] = pix.chroma[2];
|
|
1687 |
- }
|
|
1688 |
- }
|
|
1689 |
- _write += 3;
|
|
1690 |
- _read += 1;
|
|
1691 |
- x--;
|
|
1692 |
- }
|
|
1693 |
- |
|
1694 |
- read += 3*line;
|
|
1695 |
- write += blit->write_line;
|
|
1696 |
- y--;
|
|
1697 |
- }
|
|
1698 |
- while (y > 0);
|
|
1699 |
- }
|
|
1700 |
- |
|
1701 |
- |
|
1702 |
- typedef void (*grColorGlyphBlitter)( grBlitter* blit,
|
|
1703 |
- grColor color,
|
|
1704 |
- int max_gray );
|
|
1705 |
- |
|
1706 |
- static
|
|
1707 |
- const grColorGlyphBlitter gr_color_blitters[gr_pixel_mode_max] =
|
|
1708 |
- {
|
|
1709 |
- 0,
|
|
1710 |
- 0,
|
|
1711 |
- 0,
|
|
1712 |
- 0,
|
|
1713 |
- 0,
|
|
1714 |
- blit_gray_to_555,
|
|
1715 |
- blit_gray_to_565,
|
|
1716 |
- blit_gray_to_24,
|
|
1717 |
- blit_gray_to_32
|
|
1718 |
- };
|
|
1719 |
- |
|
1720 |
-#ifdef GRAY8
|
|
1721 |
- typedef void (*grGray8GlyphBlitter)( grBlitter* blit,
|
|
1722 |
- grColor color );
|
|
1723 |
- |
|
1724 |
- static
|
|
1725 |
- const grGray8GlyphBlitter gr_gray8_blitters[gr_pixel_mode_max] =
|
|
1726 |
- {
|
|
1727 |
- 0,
|
|
1728 |
- 0,
|
|
1729 |
- 0,
|
|
1730 |
- 0,
|
|
1731 |
- 0,
|
|
1732 |
- blit_gray8_to_555,
|
|
1733 |
- blit_gray8_to_565,
|
|
1734 |
- blit_gray8_to_24,
|
|
1735 |
- blit_gray8_to_32
|
|
1736 |
- };
|
|
1737 |
-#endif
|
|
1738 |
- |
|
1739 |
- |
|
1740 |
- int
|
|
1741 |
- grBlitGlyphToBitmap( grBitmap* target,
|
|
1742 |
- grBitmap* glyph,
|
|
1743 |
- grPos x,
|
|
1744 |
- grPos y,
|
|
1745 |
- grColor color )
|
|
1746 |
- {
|
|
1747 |
- grBlitter blit;
|
|
1748 |
- grPixelMode mode;
|
|
1749 |
- |
|
1750 |
- |
|
1751 |
- /* check arguments */
|
|
1752 |
- if ( !target || !glyph )
|
|
1753 |
- {
|
|
1754 |
- grError = gr_err_bad_argument;
|
|
1755 |
- return -1;
|
|
1756 |
- }
|
|
1757 |
- |
|
1758 |
- if ( !glyph->rows || !glyph->width )
|
|
1759 |
- {
|
|
1760 |
- /* nothing to do */
|
|
1761 |
- return 0;
|
|
1762 |
- }
|
|
1763 |
- |
|
1764 |
- /* set up blitter and compute clipping. Return immediately if needed */
|
|
1765 |
- blit.source = *glyph;
|
|
1766 |
- blit.target = *target;
|
|
1767 |
- mode = target->mode;
|
|
1768 |
- |
|
1769 |
- if ( compute_clips( &blit, x, y ) )
|
|
1770 |
- return 0;
|
|
1771 |
- |
|
1772 |
- switch ( glyph->mode )
|
|
1773 |
- {
|
|
1774 |
- case gr_pixel_mode_mono: /* handle monochrome bitmap blitting */
|
|
1775 |
- if ( mode <= gr_pixel_mode_none || mode >= gr_pixel_mode_max )
|
|
1776 |
- {
|
|
1777 |
- grError = gr_err_bad_source_depth;
|
|
1778 |
- return -1;
|
|
1779 |
- }
|
|
1780 |
- |
|
1781 |
- gr_mono_blitters[mode]( &blit, color );
|
|
1782 |
- break;
|
|
1783 |
- |
|
1784 |
- case gr_pixel_mode_gray:
|
|
1785 |
- if ( glyph->grays > 1 )
|
|
1786 |
- {
|
|
1787 |
- int target_grays = target->grays;
|
|
1788 |
- int source_grays = glyph->grays;
|
|
1789 |
- const byte* saturation;
|
|
1790 |
- |
|
1791 |
- |
|
1792 |
- if ( mode == gr_pixel_mode_gray && target_grays > 1 )
|
|
1793 |
- {
|
|
1794 |
- /* rendering into a gray target - use special composition */
|
|
1795 |
- /* routines.. */
|
|
1796 |
- if ( gr_last_saturation->count == target_grays )
|
|
1797 |
- saturation = gr_last_saturation->table;
|
|
1798 |
- else
|
|
1799 |
- {
|
|
1800 |
- saturation = grGetSaturation( target_grays );
|
|
1801 |
- if ( !saturation )
|
|
1802 |
- return -3;
|
|
1803 |
- }
|
|
1804 |
- |
|
1805 |
- if ( target_grays == source_grays )
|
|
1806 |
- blit_gray_to_gray_simple( &blit, saturation );
|
|
1807 |
- else
|
|
1808 |
- {
|
|
1809 |
- const byte* conversion;
|
|
1810 |
- |
|
1811 |
- |
|
1812 |
- if ( gr_last_conversion->target_grays == target_grays &&
|
|
1813 |
- gr_last_conversion->source_grays == source_grays )
|
|
1814 |
- conversion = gr_last_conversion->table;
|
|
1815 |
- else
|
|
1816 |
- {
|
|
1817 |
- conversion = grGetConversion( target_grays, source_grays );
|
|
1818 |
- if ( !conversion )
|
|
1819 |
- return -3;
|
|
1820 |
- }
|
|
1821 |
- |
|
1822 |
- blit_gray_to_gray( &blit, saturation, conversion );
|
|
1823 |
- }
|
|
1824 |
- }
|
|
1825 |
- else
|
|
1826 |
- {
|
|
1827 |
- /* rendering into a color target */
|
|
1828 |
- if ( mode <= gr_pixel_mode_gray ||
|
|
1829 |
- mode >= gr_pixel_mode_max )
|
|
1830 |
- {
|
|
1831 |
- grError = gr_err_bad_target_depth;
|
|
1832 |
- return -1;
|
|
1833 |
- }
|
|
1834 |
- |
|
1835 |
-#ifdef GRAY8
|
|
1836 |
- if ( source_grays == 256 )
|
|
1837 |
- gr_gray8_blitters[mode]( &blit, color );
|
|
1838 |
- else
|
|
1839 |
-#endif /* GRAY8 */
|
|
1840 |
- gr_color_blitters[mode]( &blit, color, source_grays - 1 );
|
|
1841 |
- }
|
|
1842 |
- }
|
|
1843 |
- break;
|
|
1844 |
- |
|
1845 |
- case gr_pixel_mode_lcd:
|
|
1846 |
- if ( mode == gr_pixel_mode_rgb24 )
|
|
1847 |
- {
|
|
1848 |
-#ifdef GRAY8
|
|
1849 |
- if ( glyph->grays == 256 )
|
|
1850 |
- blit_lcd8_to_24( &blit, color );
|
|
1851 |
- else
|
|
1852 |
-#endif
|
|
1853 |
- if ( glyph->grays > 1 )
|
|
1854 |
- blit_lcd_to_24( &blit, color, glyph->grays-1 );
|
|
1855 |
- }
|
|
1856 |
- break;
|
|
1857 |
- |
|
1858 |
- |
|
1859 |
- case gr_pixel_mode_lcdv:
|
|
1860 |
- if ( glyph->grays > 1 && mode == gr_pixel_mode_rgb24 )
|
|
1861 |
- {
|
|
1862 |
- blit_lcdv_to_24( &blit, color, glyph->grays-1 );
|
|
1863 |
- break;
|
|
1864 |
- }
|
|
1865 |
- /* fall through */
|
|
1866 |
- |
|
1867 |
- case gr_pixel_mode_lcd2:
|
|
1868 |
- if ( mode == gr_pixel_mode_rgb24 )
|
|
1869 |
- {
|
|
1870 |
-#ifdef GRAY8
|
|
1871 |
- if ( glyph->grays == 256 )
|
|
1872 |
- blit_lcd28_to_24( &blit, color );
|
|
1873 |
- else
|
|
1874 |
-#endif
|
|
1875 |
- if ( glyph->grays > 1 )
|
|
1876 |
- blit_lcd2_to_24( &blit, color, glyph->grays-1 );
|
|
1877 |
- }
|
|
1878 |
- break;
|
|
1879 |
- |
|
1880 |
- case gr_pixel_mode_lcdv2:
|
|
1881 |
- if ( mode == gr_pixel_mode_rgb24 )
|
|
1882 |
- {
|
|
1883 |
- if ( glyph->grays > 1 )
|
|
1884 |
- blit_lcdv2_to_24( &blit, color, glyph->grays-1 );
|
|
1885 |
- }
|
|
1886 |
- break;
|
|
1887 |
- |
|
1888 |
- default:
|
|
1889 |
- /* we don't support the blitting of bitmaps of the following */
|
|
1890 |
- /* types : pal4, pal8, rgb555, rgb565, rgb24, rgb32 */
|
|
1891 |
- /* */
|
|
1892 |
- grError = gr_err_bad_source_depth;
|
|
1893 |
- return -2;
|
|
1894 |
- }
|
|
1895 |
- |
|
1896 |
- return 0;
|
|
1897 |
- }
|
|
1898 |
- |
|
1899 |
- |
|
1900 |
- void
|
|
1901 |
- grBlitClean( void )
|
|
1902 |
- {
|
|
1903 |
- while ( gr_num_saturations > 2 )
|
|
1904 |
- free( (byte*)gr_saturations[gr_num_saturations--].table );
|
|
1905 |
- |
|
1906 |
- while ( gr_num_conversions > 3 )
|
|
1907 |
- free( (byte*)gr_conversions[gr_num_conversions--].table );
|
|
1908 |
- }
|
|
1909 |
- |
|
1910 |
- |
|
1911 |
-/* End */
|
1 |
-/****************************************************************************/
|
|
2 |
-/* */
|
|
3 |
-/* The FreeType project -- a free and portable quality TrueType renderer. */
|
|
4 |
-/* */
|
|
5 |
-/* Copyright (C) 1996-2021 by */
|
|
6 |
-/* D. Turner, R.Wilhelm, and W. Lemberg */
|
|
7 |
-/* */
|
|
8 |
-/* blitter.h: Support for blitting of bitmaps with various depth. */
|
|
9 |
-/* */
|
|
10 |
-/****************************************************************************/
|
|
11 |
- |
|
12 |
-#ifndef GRBLIT_H_
|
|
13 |
-#define GRBLIT_H_
|
|
14 |
- |
|
15 |
-#include "grobjs.h"
|
|
16 |
- |
|
17 |
- int grBlitMono( grBitmap* target,
|
|
18 |
- grBitmap* source,
|
|
19 |
- int x_offset,
|
|
20 |
- int y_offset,
|
|
21 |
- grColor color );
|
|
22 |
- |
|
23 |
- |
|
24 |
-#endif /* GRBLIT_H_ */
|
|
25 |
- |
|
26 |
- |
|
27 |
-/* End */
|
... | ... | @@ -2,7 +2,5 @@ |
2 | 2 |
#define GRCONFIG_H_
|
3 | 3 |
|
4 | 4 |
#define GR_FONT_SIZE 14
|
5 |
-#define GR_MAX_SATURATIONS 8
|
|
6 |
-#define GR_MAX_CONVERSIONS 16
|
|
7 | 5 |
|
8 | 6 |
#endif /* GRCONFIG_H_ */
|
... | ... | @@ -561,7 +561,7 @@ |
561 | 561 |
return;
|
562 | 562 |
|
563 | 563 |
gr_charcell.buffer = font[charcode];
|
564 |
- grBlitGlyphToBitmap( target, &gr_charcell, x, y, color );
|
|
564 |
+ grBlitGlyphToSurface( (grSurface*)target, &gr_charcell, x, y, color );
|
|
565 | 565 |
}
|
566 | 566 |
|
567 | 567 |
|
... | ... | @@ -575,7 +575,7 @@ |
575 | 575 |
while ( *string )
|
576 | 576 |
{
|
577 | 577 |
gr_charcell.buffer = font[*(unsigned char*)string++];
|
578 |
- grBlitGlyphToBitmap( target, &gr_charcell, x, y, color );
|
|
578 |
+ grBlitGlyphToSurface( (grSurface*)target, &gr_charcell, x, y, color );
|
|
579 | 579 |
x += 8;
|
580 | 580 |
}
|
581 | 581 |
}
|
... | ... | @@ -20,8 +20,6 @@ graph_sources = files([ |
20 | 20 |
'gblender.c',
|
21 | 21 |
'gblender.h',
|
22 | 22 |
'graph.h',
|
23 |
- 'grblit.c',
|
|
24 |
- 'grblit.h',
|
|
25 | 23 |
'grconfig.h',
|
26 | 24 |
'grdevice.c',
|
27 | 25 |
'grdevice.h',
|
... | ... | @@ -19,7 +19,6 @@ GRAPH_H := $(GRAPH)/gblany.h \ |
19 | 19 |
$(GRAPH)/gblblit.h \
|
20 | 20 |
$(GRAPH)/gblender.h \
|
21 | 21 |
$(GRAPH)/graph.h \
|
22 |
- $(GRAPH)/grblit.h \
|
|
23 | 22 |
$(GRAPH)/grconfig.h \
|
24 | 23 |
$(GRAPH)/grdevice.h \
|
25 | 24 |
$(GRAPH)/grevents.h \
|
... | ... | @@ -31,7 +30,6 @@ GRAPH_H := $(GRAPH)/gblany.h \ |
31 | 30 |
|
32 | 31 |
GRAPH_OBJS := $(OBJ_DIR_2)/gblblit.$(O) \
|
33 | 32 |
$(OBJ_DIR_2)/gblender.$(O) \
|
34 |
- $(OBJ_DIR_2)/grblit.$(O) \
|
|
35 | 33 |
$(OBJ_DIR_2)/grdevice.$(O) \
|
36 | 34 |
$(OBJ_DIR_2)/grfill.$(O) \
|
37 | 35 |
$(OBJ_DIR_2)/grfont.$(O) \
|
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 |
|
17 | 17 |
#include <stdlib.h>
|
18 | 18 |
#include <stdio.h>
|
19 |
+#include <limits.h>
|
|
19 | 20 |
#include <string.h>
|
20 | 21 |
#include <time.h>
|
21 | 22 |
#include <ft2build.h>
|
... | ... | @@ -148,9 +149,9 @@ |
148 | 149 |
static int preload;
|
149 | 150 |
static char* filename;
|
150 | 151 |
|
151 |
- static unsigned int first_index = 0U;
|
|
152 |
- static unsigned int last_index = ~0U;
|
|
153 |
- static int incr_index = 1;
|
|
152 |
+ static int first_index = 0;
|
|
153 |
+ static int last_index = INT_MAX;
|
|
154 |
+ static int incr_index = 1;
|
|
154 | 155 |
|
155 | 156 |
#define FOREACH( i ) for ( i = first_index ; \
|
156 | 157 |
( first_index <= i && i <= last_index ) || \
|
... | ... | @@ -316,8 +317,7 @@ |
316 | 317 |
FT_Face face,
|
317 | 318 |
void* user_data )
|
318 | 319 |
{
|
319 |
- unsigned int i;
|
|
320 |
- int done = 0;
|
|
320 |
+ int i, done = 0;
|
|
321 | 321 |
|
322 | 322 |
FT_UNUSED( user_data );
|
323 | 323 |
|
... | ... | @@ -326,7 +326,7 @@ |
326 | 326 |
|
327 | 327 |
FOREACH( i )
|
328 | 328 |
{
|
329 |
- if ( !FT_Load_Glyph( face, i, load_flags ) )
|
|
329 |
+ if ( !FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
|
330 | 330 |
done++;
|
331 | 331 |
}
|
332 | 332 |
|
... | ... | @@ -344,7 +344,7 @@ |
344 | 344 |
int done = 0;
|
345 | 345 |
FT_Fixed* advances;
|
346 | 346 |
FT_ULong flags = *((FT_ULong*)user_data);
|
347 |
- FT_UInt start, count;
|
|
347 |
+ FT_Int start, count;
|
|
348 | 348 |
|
349 | 349 |
|
350 | 350 |
if ( incr_index > 0 )
|
... | ... | @@ -362,7 +362,9 @@ |
362 | 362 |
|
363 | 363 |
TIMER_START( timer );
|
364 | 364 |
|
365 |
- FT_Get_Advances( face, start, count, (FT_Int32)flags, advances );
|
|
365 |
+ FT_Get_Advances( face,
|
|
366 |
+ (FT_UInt)start, (FT_UInt)count,
|
|
367 |
+ (FT_Int32)flags, advances );
|
|
366 | 368 |
done += (int)count;
|
367 | 369 |
|
368 | 370 |
TIMER_STOP( timer );
|
... | ... | @@ -378,15 +380,14 @@ |
378 | 380 |
FT_Face face,
|
379 | 381 |
void* user_data )
|
380 | 382 |
{
|
381 |
- unsigned int i;
|
|
382 |
- int done = 0;
|
|
383 |
+ int i, done = 0;
|
|
383 | 384 |
|
384 | 385 |
FT_UNUSED( user_data );
|
385 | 386 |
|
386 | 387 |
|
387 | 388 |
FOREACH( i )
|
388 | 389 |
{
|
389 |
- if ( FT_Load_Glyph( face, i, load_flags ) )
|
|
390 |
+ if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
|
390 | 391 |
continue;
|
391 | 392 |
|
392 | 393 |
TIMER_START( timer );
|
... | ... | @@ -404,15 +405,14 @@ |
404 | 405 |
FT_Face face,
|
405 | 406 |
void* user_data )
|
406 | 407 |
{
|
407 |
- unsigned int i;
|
|
408 |
- int done = 0;
|
|
408 |
+ int i, done = 0;
|
|
409 | 409 |
|
410 | 410 |
FT_UNUSED( user_data );
|
411 | 411 |
|
412 | 412 |
|
413 | 413 |
FOREACH( i )
|
414 | 414 |
{
|
415 |
- if ( FT_Load_Glyph( face, i, load_flags ) )
|
|
415 |
+ if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
|
416 | 416 |
continue;
|
417 | 417 |
|
418 | 418 |
TIMER_START( timer );
|
... | ... | @@ -430,10 +430,10 @@ |
430 | 430 |
FT_Face face,
|
431 | 431 |
void* user_data )
|
432 | 432 |
{
|
433 |
- FT_Glyph glyph;
|
|
434 |
- FT_Stroker stroker;
|
|
435 |
- unsigned int i;
|
|
436 |
- int done = 0;
|
|
433 |
+ FT_Glyph glyph;
|
|
434 |
+ FT_Stroker stroker;
|
|
435 |
+ |
|
436 |
+ int i, done = 0;
|
|
437 | 437 |
|
438 | 438 |
FT_UNUSED( user_data );
|
439 | 439 |
|
... | ... | @@ -446,7 +446,7 @@ |
446 | 446 |
|
447 | 447 |
FOREACH( i )
|
448 | 448 |
{
|
449 |
- if ( FT_Load_Glyph( face, i, load_flags ) )
|
|
449 |
+ if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
|
450 | 450 |
continue;
|
451 | 451 |
|
452 | 452 |
if ( FT_Get_Glyph( face->glyph, &glyph ) )
|
... | ... | @@ -469,16 +469,16 @@ |
469 | 469 |
FT_Face face,
|
470 | 470 |
void* user_data )
|
471 | 471 |
{
|
472 |
- FT_Glyph glyph;
|
|
473 |
- unsigned int i;
|
|
474 |
- int done = 0;
|
|
472 |
+ FT_Glyph glyph;
|
|
473 |
+ |
|
474 |
+ int i, done = 0;
|
|
475 | 475 |
|
476 | 476 |
FT_UNUSED( user_data );
|
477 | 477 |
|
478 | 478 |
|
479 | 479 |
FOREACH( i )
|
480 | 480 |
{
|
481 |
- if ( FT_Load_Glyph( face, i, load_flags ) )
|
|
481 |
+ if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
|
482 | 482 |
continue;
|
483 | 483 |
|
484 | 484 |
TIMER_START( timer );
|
... | ... | @@ -499,17 +499,17 @@ |
499 | 499 |
FT_Face face,
|
500 | 500 |
void* user_data )
|
501 | 501 |
{
|
502 |
- FT_Glyph glyph;
|
|
503 |
- FT_BBox bbox;
|
|
504 |
- unsigned int i;
|
|
505 |
- int done = 0;
|
|
502 |
+ FT_Glyph glyph;
|
|
503 |
+ FT_BBox bbox;
|
|
504 |
+ |
|
505 |
+ int i, done = 0;
|
|
506 | 506 |
|
507 | 507 |
FT_UNUSED( user_data );
|
508 | 508 |
|
509 | 509 |
|
510 | 510 |
FOREACH( i )
|
511 | 511 |
{
|
512 |
- if ( FT_Load_Glyph( face, i, load_flags ) )
|
|
512 |
+ if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
|
513 | 513 |
continue;
|
514 | 514 |
|
515 | 515 |
if ( FT_Get_Glyph( face->glyph, &glyph ) )
|
... | ... | @@ -532,10 +532,10 @@ |
532 | 532 |
FT_Face face,
|
533 | 533 |
void* user_data )
|
534 | 534 |
{
|
535 |
- FT_BBox bbox;
|
|
536 |
- unsigned int i;
|
|
537 |
- int done = 0;
|
|
538 |
- FT_Matrix rot30 = { 0xDDB4, -0x8000, 0x8000, 0xDDB4 };
|
|
535 |
+ FT_BBox bbox;
|
|
536 |
+ FT_Matrix rot30 = { 0xDDB4, -0x8000, 0x8000, 0xDDB4 };
|
|
537 |
+ |
|
538 |
+ int i, done = 0;
|
|
539 | 539 |
|
540 | 540 |
FT_UNUSED( user_data );
|
541 | 541 |
|
... | ... | @@ -545,7 +545,7 @@ |
545 | 545 |
FT_Outline* outline;
|
546 | 546 |
|
547 | 547 |
|
548 |
- if ( FT_Load_Glyph( face, i, load_flags ) )
|
|
548 |
+ if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
|
549 | 549 |
continue;
|
550 | 550 |
|
551 | 551 |
outline = &face->glyph->outline;
|
... | ... | @@ -626,9 +626,9 @@ |
626 | 626 |
FT_Face face,
|
627 | 627 |
void* user_data )
|
628 | 628 |
{
|
629 |
- FT_Glyph glyph;
|
|
630 |
- unsigned int i;
|
|
631 |
- int done = 0;
|
|
629 |
+ FT_Glyph glyph;
|
|
630 |
+ |
|
631 |
+ int i, done = 0;
|
|
632 | 632 |
|
633 | 633 |
FT_UNUSED( face );
|
634 | 634 |
FT_UNUSED( user_data );
|
... | ... | @@ -646,7 +646,7 @@ |
646 | 646 |
{
|
647 | 647 |
if ( !FTC_ImageCache_Lookup( image_cache,
|
648 | 648 |
&font_type,
|
649 |
- i,
|
|
649 |
+ (FT_UInt)i,
|
|
650 | 650 |
&glyph,
|
651 | 651 |
NULL ) )
|
652 | 652 |
done++;
|
... | ... | @@ -663,9 +663,9 @@ |
663 | 663 |
FT_Face face,
|
664 | 664 |
void* user_data )
|
665 | 665 |
{
|
666 |
- FTC_SBit glyph;
|
|
667 |
- unsigned int i;
|
|
668 |
- int done = 0;
|
|
666 |
+ FTC_SBit glyph;
|
|
667 |
+ |
|
668 |
+ int i, done = 0;
|
|
669 | 669 |
|
670 | 670 |
FT_UNUSED( face );
|
671 | 671 |
FT_UNUSED( user_data );
|
... | ... | @@ -683,7 +683,7 @@ |
683 | 683 |
{
|
684 | 684 |
if ( !FTC_SBitCache_Lookup( sbit_cache,
|
685 | 685 |
&font_type,
|
686 |
- i,
|
|
686 |
+ (FT_UInt)i,
|
|
687 | 687 |
&glyph,
|
688 | 688 |
NULL ) )
|
689 | 689 |
done++;
|
... | ... | @@ -747,8 +747,7 @@ |
747 | 747 |
{
|
748 | 748 |
FT_Face bench_face;
|
749 | 749 |
|
750 |
- unsigned int i;
|
|
751 |
- int done = 0;
|
|
750 |
+ int i, done = 0;
|
|
752 | 751 |
|
753 | 752 |
FT_UNUSED( face );
|
754 | 753 |
FT_UNUSED( user_data );
|
... | ... | @@ -760,7 +759,7 @@ |
760 | 759 |
{
|
761 | 760 |
FOREACH( i )
|
762 | 761 |
{
|
763 |
- if ( !FT_Load_Glyph( bench_face, i, load_flags ) )
|
|
762 |
+ if ( !FT_Load_Glyph( bench_face, (FT_UInt)i, load_flags ) )
|
|
764 | 763 |
done++;
|
765 | 764 |
}
|
766 | 765 |
|
... | ... | @@ -782,7 +781,6 @@ |
782 | 781 |
bcharset_t* charset )
|
783 | 782 |
{
|
784 | 783 |
FT_ULong charcode;
|
785 |
- FT_UInt gindex;
|
|
786 | 784 |
int i = 0;
|
787 | 785 |
|
788 | 786 |
|
... | ... | @@ -793,27 +791,33 @@ |
793 | 791 |
|
794 | 792 |
if ( face->charmap )
|
795 | 793 |
{
|
796 |
- charcode = FT_Get_First_Char( face, &gindex );
|
|
794 |
+ FT_UInt idx;
|
|
795 |
+ |
|
796 |
+ |
|
797 |
+ charcode = FT_Get_First_Char( face, &idx );
|
|
797 | 798 |
|
798 | 799 |
/* certain fonts contain a broken charmap that will map character */
|
799 | 800 |
/* codes to out-of-bounds glyph indices. Take care of that here. */
|
800 | 801 |
/* */
|
801 |
- while ( gindex && i < face->num_glyphs )
|
|
802 |
+ while ( idx && i < face->num_glyphs )
|
|
802 | 803 |
{
|
804 |
+ FT_Int gindex = (FT_Int)idx;
|
|
805 |
+ |
|
806 |
+ |
|
803 | 807 |
if ( ( first_index <= gindex && gindex <= last_index ) ||
|
804 | 808 |
( first_index >= gindex && gindex >= last_index ) )
|
805 | 809 |
charset->code[i++] = charcode;
|
806 |
- charcode = FT_Get_Next_Char( face, charcode, &gindex );
|
|
810 |
+ charcode = FT_Get_Next_Char( face, charcode, &idx );
|
|
807 | 811 |
}
|
808 | 812 |
}
|
809 | 813 |
else
|
810 | 814 |
{
|
811 |
- unsigned int j;
|
|
815 |
+ int j;
|
|
812 | 816 |
|
813 | 817 |
|
814 | 818 |
/* no charmap, do an identity mapping */
|
815 | 819 |
FOREACH( j )
|
816 |
- charset->code[i++] = j;
|
|
820 |
+ charset->code[i++] = (FT_ULong)j;
|
|
817 | 821 |
}
|
818 | 822 |
|
819 | 823 |
charset->size = i;
|
... | ... | @@ -1134,12 +1138,12 @@ |
1134 | 1138 |
|
1135 | 1139 |
case 'i':
|
1136 | 1140 |
{
|
1137 |
- unsigned int fi, li;
|
|
1141 |
+ int fi, li;
|
|
1138 | 1142 |
|
1139 |
- if ( sscanf( optarg, "%u%*[,:-]%u", &fi, &li ) == 2 )
|
|
1143 |
+ if ( sscanf( optarg, "%d%*[,:-]%d", &fi, &li ) == 2 )
|
|
1140 | 1144 |
{
|
1141 |
- first_index = fi;
|
|
1142 |
- last_index = li;
|
|
1145 |
+ first_index = fi < 0 ? 0 : fi;
|
|
1146 |
+ last_index = li < 0 ? 0 : li;
|
|
1143 | 1147 |
}
|
1144 | 1148 |
}
|
1145 | 1149 |
break;
|
... | ... | @@ -1238,11 +1242,11 @@ |
1238 | 1242 |
if ( get_face( &face ) )
|
1239 | 1243 |
goto Exit;
|
1240 | 1244 |
|
1241 |
- if ( first_index >= (unsigned int)face->num_glyphs )
|
|
1242 |
- first_index = (unsigned int)face->num_glyphs - 1;
|
|
1243 |
- if ( last_index >= (unsigned int)face->num_glyphs )
|
|
1244 |
- last_index = (unsigned int)face->num_glyphs - 1;
|
|
1245 |
- incr_index = last_index > first_index ? 1 : -1;
|
|
1245 |
+ if ( first_index >= face->num_glyphs )
|
|
1246 |
+ first_index = face->num_glyphs - 1;
|
|
1247 |
+ if ( last_index >= face->num_glyphs )
|
|
1248 |
+ last_index = face->num_glyphs - 1;
|
|
1249 |
+ incr_index = last_index > first_index ? 1 : -1;
|
|
1246 | 1250 |
|
1247 | 1251 |
if ( size )
|
1248 | 1252 |
{
|
... | ... | @@ -1300,7 +1304,7 @@ |
1300 | 1304 |
max_time );
|
1301 | 1305 |
|
1302 | 1306 |
printf( "\n"
|
1303 |
- "glyph indices: from %u to %u\n"
|
|
1307 |
+ "glyph indices: from %d to %d\n"
|
|
1304 | 1308 |
"face size: %uppem\n"
|
1305 | 1309 |
"font preloading into memory: %s\n",
|
1306 | 1310 |
first_index,
|
... | ... | @@ -466,7 +466,7 @@ |
466 | 466 |
|
467 | 467 |
for ( ; count--; spans++ )
|
468 | 468 |
for ( dst = dst_line + spans->x, w = spans->len; w--; dst++ )
|
469 |
- *dst = ( spans->coverage << 24 ) | color;
|
|
469 |
+ *dst = (FT_UInt32)( spans->coverage << 24 ) | color;
|
|
470 | 470 |
}
|
471 | 471 |
|
472 | 472 |
|
... | ... | @@ -1172,7 +1172,7 @@ |
1172 | 1172 |
strbuf_reset( buf );
|
1173 | 1173 |
FTDemo_Get_Info( handle, buf );
|
1174 | 1174 |
grWriteCellString( display->bitmap,
|
1175 |
- display->bitmap->width - 8 * strbuf_len( buf ),
|
|
1175 |
+ display->bitmap->width - 8 * (int)strbuf_len( buf ),
|
|
1176 | 1176 |
line * HEADER_HEIGHT,
|
1177 | 1177 |
strbuf_value( buf ), display->fore_color );
|
1178 | 1178 |
|
... | ... | @@ -149,8 +149,8 @@ |
149 | 149 |
if ( head )
|
150 | 150 |
{
|
151 | 151 |
char buf[11];
|
152 |
- time_t created = head->Created [1];
|
|
153 |
- time_t modified = head->Modified[1];
|
|
152 |
+ time_t created = (time_t)head->Created [1];
|
|
153 |
+ time_t modified = (time_t)head->Modified[1];
|
|
154 | 154 |
|
155 | 155 |
|
156 | 156 |
/* ignore most of upper bits until 2176 and adjust epoch */
|
... | ... | @@ -536,8 +536,8 @@ |
536 | 536 |
else if ( !FT_Get_BDF_Charset_ID( face, &encoding, ®istry ) )
|
537 | 537 |
printf( ", charset %s-%s", registry, encoding );
|
538 | 538 |
else if ( !FT_Get_WinFNT_Header( face, &header ) )
|
539 |
- printf( header.charset < 10 ? ", charset %hu"
|
|
540 |
- : ", charset %hu <%hX>",
|
|
539 |
+ printf( header.charset < 10 ? ", charset %hhu"
|
|
540 |
+ : ", charset %hhu <%hhX>",
|
|
541 | 541 |
header.charset, header.charset );
|
542 | 542 |
|
543 | 543 |
printf ( "\n" );
|
... | ... | @@ -566,7 +566,7 @@ |
566 | 566 |
}
|
567 | 567 |
else if ( coverage == 1 )
|
568 | 568 |
{
|
569 |
- FT_ULong next, last = ~1;
|
|
569 |
+ FT_ULong next, last = ~1U;
|
|
570 | 570 |
FT_UInt gindex;
|
571 | 571 |
|
572 | 572 |
const char* f1 = "";
|
... | ... | @@ -1053,7 +1053,7 @@ |
1053 | 1053 |
|
1054 | 1054 |
/* The floating scale is reversibly adjusted after decomposing it into */
|
1055 | 1055 |
/* fraction and exponent. Direct bit manipulation is less portable. */
|
1056 |
- frc = 8 * frexpf( status.scale, &exp );
|
|
1056 |
+ frc = (int)( 8 * frexpf( status.scale, &exp ) );
|
|
1057 | 1057 |
|
1058 | 1058 |
frc = ( frc & 3 ) | ( exp << 2 );
|
1059 | 1059 |
frc += step;
|
... | ... | @@ -97,14 +97,16 @@ |
97 | 97 |
for ( d0 = d1 = 0, j = 0; j < bitmap->width; j++, b++ )
|
98 | 98 |
{
|
99 | 99 |
d1 -= *b;
|
100 |
- s2 += d1 >= d0 ? d1 - d0 : d0 - d1; /* second derivative sum */
|
|
101 |
- s1 += d1 >= 0 ? d1 : -d1; /* first derivative sum */
|
|
100 |
+ /* second derivative sum */
|
|
101 |
+ s2 += (unsigned long)( d1 >= d0 ? d1 - d0 : d0 - d1 );
|
|
102 |
+ /* first derivative sum */
|
|
103 |
+ s1 += (unsigned long)( d1 >= 0 ? d1 : -d1 );
|
|
102 | 104 |
d0 = d1;
|
103 | 105 |
d1 = *b;
|
104 | 106 |
}
|
105 |
- s2 += d1 > d0 ? d1 - d0 : d0 - d1;
|
|
106 |
- s2 += d1;
|
|
107 |
- s1 += d1;
|
|
107 |
+ s2 += (unsigned long)( d1 > d0 ? d1 - d0 : d0 - d1 );
|
|
108 |
+ s2 += (unsigned long)d1;
|
|
109 |
+ s1 += (unsigned long)d1;
|
|
108 | 110 |
}
|
109 | 111 |
|
110 | 112 |
printf( "%.4lf ", s1 ? (double)s2 / s1 : 2.0 );
|
... | ... | @@ -116,14 +118,16 @@ |
116 | 118 |
for ( d0 = d1 = 0, i = 0; i < bitmap->rows; i++, b += bitmap->pitch )
|
117 | 119 |
{
|
118 | 120 |
d1 -= *b;
|
119 |
- s2 += d1 >= d0 ? d1 - d0 : d0 - d1; /* second derivative sum */
|
|
120 |
- s1 += d1 >= 0 ? d1 : -d1; /* first derivative sum */
|
|
121 |
+ /* second derivative sum */
|
|
122 |
+ s2 += (unsigned long)( d1 >= d0 ? d1 - d0 : d0 - d1 );
|
|
123 |
+ /* first derivative sum */
|
|
124 |
+ s1 += (unsigned long)( d1 >= 0 ? d1 : -d1 );
|
|
121 | 125 |
d0 = d1;
|
122 | 126 |
d1 = *b;
|
123 | 127 |
}
|
124 |
- s2 += d1 > d0 ? d1 - d0 : d0 - d1;
|
|
125 |
- s2 += d1;
|
|
126 |
- s1 += d1;
|
|
128 |
+ s2 += (unsigned long)( d1 > d0 ? d1 - d0 : d0 - d1 );
|
|
129 |
+ s2 += (unsigned long)d1;
|
|
130 |
+ s1 += (unsigned long)d1;
|
|
127 | 131 |
}
|
128 | 132 |
|
129 | 133 |
printf( "%.4lf ", s1 ? (double)s2 / s1 : 2.0 );
|
... | ... | @@ -261,7 +261,7 @@ |
261 | 261 |
}
|
262 | 262 |
}
|
263 | 263 |
|
264 |
- num_shown_axes = idx + 1;
|
|
264 |
+ num_shown_axes = (unsigned int)( idx + 1 );
|
|
265 | 265 |
}
|
266 | 266 |
else
|
267 | 267 |
{
|
... | ... | @@ -270,7 +270,7 @@ |
270 | 270 |
|
271 | 271 |
/* show all axes */
|
272 | 272 |
for ( i = 0; i < used_num_axis; i++ )
|
273 |
- shown_axes[i] = i;
|
|
273 |
+ shown_axes[i] = (int)i;
|
|
274 | 274 |
|
275 | 275 |
num_shown_axes = used_num_axis;
|
276 | 276 |
}
|
... | ... | @@ -282,7 +282,8 @@ |
282 | 282 |
Clear_Display( void )
|
283 | 283 |
{
|
284 | 284 |
memset( bit->buffer, 0, (size_t)bit->rows *
|
285 |
- ( bit->pitch < 0 ? -bit->pitch : bit->pitch ) );
|
|
285 |
+ (size_t)( bit->pitch < 0 ? -bit->pitch
|
|
286 |
+ : bit->pitch ) );
|
|
286 | 287 |
}
|
287 | 288 |
|
288 | 289 |
|
... | ... | @@ -84,7 +84,8 @@ |
84 | 84 |
png_init_io( png_ptr, fp );
|
85 | 85 |
|
86 | 86 |
/* Write header (8 bit colour depth) */
|
87 |
- png_set_IHDR( png_ptr, info_ptr, width, height,
|
|
87 |
+ png_set_IHDR( png_ptr, info_ptr,
|
|
88 |
+ (png_uint_32)width, (png_uint_32)height,
|
|
88 | 89 |
8, color_type, PNG_INTERLACE_NONE,
|
89 | 90 |
PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE );
|
90 | 91 |
|
1 |
+/****************************************************************************/
|
|
2 |
+/* */
|
|
3 |
+/* The FreeType project -- a free and portable quality TrueType renderer. */
|
|
4 |
+/* */
|
|
5 |
+/* Copyright (C) 2021 by */
|
|
6 |
+/* D. Turner, R.Wilhelm, W. Lemberg, and Anuj Verma */
|
|
7 |
+/* */
|
|
8 |
+/* */
|
|
9 |
+/* FTSdf - a simple font viewer for FreeType's SDF output. */
|
|
10 |
+/* */
|
|
11 |
+/* Press ? when running this program to have a list of key-bindings. */
|
|
12 |
+/* */
|
|
13 |
+/****************************************************************************/
|
|
14 |
+ |
|
1 | 15 |
|
2 | 16 |
#include <freetype/ftmodapi.h>
|
3 | 17 |
|
... | ... | @@ -31,7 +45,7 @@ |
31 | 45 |
FT_Face face;
|
32 | 46 |
FT_Int ptsize;
|
33 | 47 |
FT_Int glyph_index;
|
34 |
- FT_Int scale;
|
|
48 |
+ FT_UInt scale;
|
|
35 | 49 |
FT_Int spread;
|
36 | 50 |
FT_Int x_offset;
|
37 | 51 |
FT_Int y_offset;
|
... | ... | @@ -89,8 +103,8 @@ |
89 | 103 |
&status.overlaps ) );
|
90 | 104 |
|
91 | 105 |
/* Set pixel size and load the glyph index. */
|
92 |
- FT_CALL( FT_Set_Pixel_Sizes( status.face, 0, status.ptsize ) );
|
|
93 |
- FT_CALL( FT_Load_Glyph( status.face, status.glyph_index,
|
|
106 |
+ FT_CALL( FT_Set_Pixel_Sizes( status.face, 0, (FT_UInt)status.ptsize ) );
|
|
107 |
+ FT_CALL( FT_Load_Glyph( status.face, (FT_UInt)status.glyph_index,
|
|
94 | 108 |
FT_LOAD_DEFAULT ) );
|
95 | 109 |
|
96 | 110 |
/* This is just to measure the generation time. */
|
... | ... | @@ -209,7 +223,7 @@ |
209 | 223 |
|
210 | 224 |
|
211 | 225 |
sprintf( header_string,
|
212 |
- "Glyph Index: %d, Pt Size: %d, Spread: %d, Scale: %d",
|
|
226 |
+ "Glyph Index: %d, Pt Size: %d, Spread: %d, Scale: %u",
|
|
213 | 227 |
status.glyph_index,
|
214 | 228 |
status.ptsize,
|
215 | 229 |
status.spread,
|
... | ... | @@ -258,7 +272,7 @@ |
258 | 272 |
grEvent event;
|
259 | 273 |
|
260 | 274 |
int ret = 0;
|
261 |
- int speed = 10 * status.scale;
|
|
275 |
+ int speed = 10 * (int)status.scale;
|
|
262 | 276 |
|
263 | 277 |
|
264 | 278 |
grListenSurface( display->surface, 0, &event );
|
... | ... | @@ -393,7 +407,7 @@ |
393 | 407 |
|
394 | 408 |
|
395 | 409 |
/* Clamp value `x` between `lower_limit` and `upper_limit`. */
|
396 |
- float
|
|
410 |
+ static float
|
|
397 | 411 |
clamp( float x,
|
398 | 412 |
float lower_limit,
|
399 | 413 |
float upper_limit )
|
... | ... | @@ -413,7 +427,7 @@ |
413 | 427 |
/* This implementation is taken from Wikipedia. */
|
414 | 428 |
/* */
|
415 | 429 |
/* https://en.wikipedia.org/wiki/Smoothstep */
|
416 |
- float
|
|
430 |
+ static float
|
|
417 | 431 |
smoothstep( float edge0,
|
418 | 432 |
float edge1,
|
419 | 433 |
float x )
|
... | ... | @@ -456,10 +470,10 @@ |
456 | 470 |
center.y = display->bitmap->rows / 2;
|
457 | 471 |
|
458 | 472 |
/* compute draw region around `center` */
|
459 |
- draw_region.xMin = center.x - ( bitmap->width * status.scale) / 2;
|
|
460 |
- draw_region.xMax = center.x + ( bitmap->width * status.scale) / 2;
|
|
461 |
- draw_region.yMin = center.y - ( bitmap->rows * status.scale) / 2;
|
|
462 |
- draw_region.yMax = center.y + ( bitmap->rows * status.scale) / 2;
|
|
473 |
+ draw_region.xMin = center.x - ( bitmap->width * status.scale ) / 2;
|
|
474 |
+ draw_region.xMax = center.x + ( bitmap->width * status.scale ) / 2;
|
|
475 |
+ draw_region.yMin = center.y - ( bitmap->rows * status.scale ) / 2;
|
|
476 |
+ draw_region.yMax = center.y + ( bitmap->rows * status.scale ) / 2;
|
|
463 | 477 |
|
464 | 478 |
/* add position offset so that we can move the image */
|
465 | 479 |
draw_region.xMin += status.x_offset;
|
... | ... | @@ -509,23 +523,25 @@ |
509 | 523 |
|
510 | 524 |
/* Finally loop over all pixels inside the draw region */
|
511 | 525 |
/* and copy pixels from the sample region to the draw region. */
|
512 |
- for ( FT_Int j = draw_region.yMax - 1, y = sample_region.yMin;
|
|
526 |
+ for ( FT_UInt j = (FT_UInt)( draw_region.yMax - 1 ),
|
|
527 |
+ y = (FT_UInt)sample_region.yMin;
|
|
513 | 528 |
j >= draw_region.yMin;
|
514 | 529 |
j--, y++ )
|
515 | 530 |
{
|
516 |
- for ( FT_Int i = draw_region.xMin, x = sample_region.xMin;
|
|
531 |
+ for ( FT_UInt i = (FT_UInt)draw_region.xMin,
|
|
532 |
+ x = (FT_UInt)sample_region.xMin;
|
|
517 | 533 |
i < draw_region.xMax;
|
518 | 534 |
i++, x++ )
|
519 | 535 |
{
|
520 |
- FT_UInt display_index = j * display->bitmap->width + i;
|
|
536 |
+ FT_UInt display_index = j * (FT_UInt)display->bitmap->width + i;
|
|
521 | 537 |
float min_dist;
|
522 | 538 |
|
523 | 539 |
|
524 | 540 |
if ( status.nearest_filtering )
|
525 | 541 |
{
|
526 | 542 |
FT_UInt bitmap_index = ( y / status.scale ) * bitmap->width +
|
527 |
- x / status.scale;
|
|
528 |
- FT_Byte pixel_value = buffer[bitmap_index];
|
|
543 |
+ x / status.scale;
|
|
544 |
+ FT_Byte pixel_value = buffer[bitmap_index];
|
|
529 | 545 |
|
530 | 546 |
|
531 | 547 |
/* If nearest filtering then simply take the value of the */
|
... | ... | @@ -217,7 +217,7 @@ |
217 | 217 |
|
218 | 218 |
outline = &((FT_OutlineGlyph)*glyph)->outline;
|
219 | 219 |
|
220 |
- FT_Outline_New( handle->library, points, contours, outline );
|
|
220 |
+ FT_Outline_New( handle->library, points, (FT_Int)contours, outline );
|
|
221 | 221 |
outline->n_points = outline->n_contours = 0;
|
222 | 222 |
|
223 | 223 |
FT_Stroker_Export( handle->stroker, outline );
|
... | ... | @@ -430,7 +430,7 @@ |
430 | 430 |
slot = face->glyph;
|
431 | 431 |
|
432 | 432 |
error = FT_Palette_Select( face,
|
433 |
- handle->current_font->palette_index,
|
|
433 |
+ (FT_UShort)handle->current_font->palette_index,
|
|
434 | 434 |
&palette );
|
435 | 435 |
if ( error )
|
436 | 436 |
palette = NULL;
|
... | ... | @@ -171,9 +171,9 @@ |
171 | 171 |
return (int)available;
|
172 | 172 |
}
|
173 | 173 |
|
174 |
- sb->pos += ret;
|
|
174 |
+ sb->pos += (unsigned)ret;
|
|
175 | 175 |
|
176 |
- return (int)ret;
|
|
176 |
+ return ret;
|
|
177 | 177 |
}
|
178 | 178 |
|
179 | 179 |
|
... | ... | @@ -103,8 +103,7 @@ OBJDIR = [.objs] |
103 | 103 |
# include paths
|
104 | 104 |
INCLUDES = /include=([-.freetype2.include],[.graph],[.src])
|
105 | 105 |
|
106 |
-GRAPHOBJ = $(OBJDIR)grblit.obj, \
|
|
107 |
- $(OBJDIR)grobjs.obj, \
|
|
106 |
+GRAPHOBJ = $(OBJDIR)grobjs.obj, \
|
|
108 | 107 |
$(OBJDIR)grfont.obj, \
|
109 | 108 |
$(OBJDIR)grinit.obj, \
|
110 | 109 |
$(OBJDIR)grdevice.obj,\
|
... | ... | @@ -112,8 +111,7 @@ GRAPHOBJ = $(OBJDIR)grblit.obj, \ |
112 | 111 |
$(OBJDIR)gblender.obj, \
|
113 | 112 |
$(OBJDIR)gblblit.obj,$(OBJDIR)grfill.obj
|
114 | 113 |
|
115 |
-GRAPHOBJ64 = $(OBJDIR)grblit_64.obj, \
|
|
116 |
- $(OBJDIR)grobjs_64.obj, \
|
|
114 |
+GRAPHOBJ64 = $(OBJDIR)grobjs_64.obj, \
|
|
117 | 115 |
$(OBJDIR)grfont_64.obj, \
|
118 | 116 |
$(OBJDIR)grinit_64.obj, \
|
119 | 117 |
$(OBJDIR)grdevice_64.obj,\
|
... | ... | @@ -272,7 +270,6 @@ $(OBJDIR)ftmemchk.obj : $(SRCDIR)ftmemchk.c |
272 | 270 |
$(OBJDIR)ftdump.obj : $(SRCDIR)ftdump.c
|
273 | 271 |
$(OBJDIR)testname.obj : $(SRCDIR)testname.c
|
274 | 272 |
$(OBJDIR)ftview.obj : $(SRCDIR)ftview.c
|
275 |
-$(OBJDIR)grblit.obj : $(GRAPHSRC)grblit.c
|
|
276 | 273 |
$(OBJDIR)grobjs.obj : $(GRAPHSRC)grobjs.c
|
277 | 274 |
$(OBJDIR)grfont.obj : $(GRAPHSRC)grfont.c
|
278 | 275 |
$(OBJDIR)gblender.obj : $(GRAPHSRC)gblender.c
|