Lines 1-15
Link Here
|
1 |
--- src/gdevgdi.c.orig Wed Jun 19 19:32:49 2002 |
1 |
--- src/gdevgdi.c.orig Wed Jun 19 19:32:49 2002 |
2 |
+++ src/gdevgdi.c Sun Nov 10 22:37:00 2002 |
2 |
+++ src/gdevgdi.c Mon Jul 21 13:44:41 2003 |
3 |
@@ -86,9 +86,9 @@ |
3 |
@@ -60,8 +60,8 @@ |
|
|
4 |
#define GDI_REPEAT_LENGTH 2 |
5 |
#define GDI_BAND_HEIGHT 128 |
6 |
#define GDI_MAX_BAND 66 |
7 |
-//#define GDI_BAND_WIDTH 4928 |
8 |
-//#define GDI_BAND_WIDTH_BYTES (((GDI_BAND_WIDTH + 31)/32)*4) |
9 |
+/*#define GDI_BAND_WIDTH 4928*/ |
10 |
+/*#define GDI_BAND_WIDTH_BYTES (((GDI_BAND_WIDTH + 31)/32)*4)*/ |
11 |
|
12 |
#define GDI_PRE_COMP 2 |
13 |
#define GDI_REAL_COMP 0 |
14 |
@@ -74,8 +74,8 @@ |
15 |
|
16 |
#define GDI_MARGINS_A4 0.167, 0.167, 0.167, 0.167 |
17 |
#define GDI_MARGINS_LETTER 0.167, 0.167, 0.167, 0.167 |
18 |
-//#define GDI_MARGINS_A4 0.0, 0.0, 0.0, 0.0 |
19 |
-//#define GDI_MARGINS_LETTER 0.0, 0.0, 0.0, 0.0 |
20 |
+/*#define GDI_MARGINS_A4 0.0, 0.0, 0.0, 0.0*/ |
21 |
+/*#define GDI_MARGINS_LETTER 0.0, 0.0, 0.0, 0.0*/ |
22 |
|
23 |
/* The number of blank lines that make it worthwhile to reposition */ |
24 |
/* the cursor. */ |
25 |
@@ -86,9 +86,15 @@ |
4 |
|
26 |
|
5 |
int GDI_BAND_WIDTH[] = {4768, 4928}; |
27 |
int GDI_BAND_WIDTH[] = {4768, 4928}; |
6 |
|
28 |
|
7 |
-private int gdi_print_page(P2(gx_device_printer *pdev, FILE *prn_stream)); |
29 |
+#if GS_VERSION_MAJOR >= 8 |
8 |
-private int gdi_open(P1(gx_device *pdev)); |
|
|
9 |
-private int gdi_close(P1(gx_device *pdev)); |
10 |
+private int gdi_print_page(gx_device_printer *pdev, FILE *prn_stream); |
30 |
+private int gdi_print_page(gx_device_printer *pdev, FILE *prn_stream); |
11 |
+private int gdi_open(gx_device *pdev); |
31 |
+private int gdi_open(gx_device *pdev); |
12 |
+private int gdi_close(gx_device *pdev); |
32 |
+private int gdi_close(gx_device *pdev); |
|
|
33 |
+#else |
34 |
private int gdi_print_page(P2(gx_device_printer *pdev, FILE *prn_stream)); |
35 |
private int gdi_open(P1(gx_device *pdev)); |
36 |
private int gdi_close(P1(gx_device *pdev)); |
37 |
+#endif |
13 |
|
38 |
|
14 |
/* The device descriptors */ |
39 |
/* The device descriptors */ |
15 |
private dev_proc_open_device(gdi_open); |
40 |
private dev_proc_open_device(gdi_open); |
|
|
41 |
@@ -107,6 +113,14 @@ |
42 |
1, /* color bit */ |
43 |
gdi_print_page); |
44 |
|
45 |
+gx_device_printer far_data gs_samsunggdi_device = |
46 |
+ prn_device(prn_gdi_procs, "samsunggdi", |
47 |
+ DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS, /* paper size (unit : 10/72 inch size) */ |
48 |
+ X_DPI2, Y_DPI2, |
49 |
+ 0.20, 0.25, 0.25, 0.25, /* margins filled in by gdi_open */ |
50 |
+ 1, /* color bit */ |
51 |
+ gdi_print_page); |
52 |
+ |
53 |
private FILE *WritePJLHeaderData(gx_device_printer *pdev, FILE *fp); |
54 |
private FILE *WriteBandHeader(FILE *fp, unsigned int usBandNo, |
55 |
unsigned char ubCompMode, unsigned int usBandWidth, |
56 |
@@ -220,7 +234,7 @@ |
57 |
memset(obp, 0x00, ul_band_size*13/10); |
58 |
for (j=0; j<band_height; j++) { |
59 |
memset(tmp, 0x00, raster); |
60 |
- //code = gdev_prn_copy_scan_lines(pdev, i*band_height+j, |
61 |
+ /*code = gdev_prn_copy_scan_lines(pdev, i*band_height+j, */ |
62 |
if (y == num_rows) break; |
63 |
code = gdev_prn_copy_scan_lines(pdev, y++, |
64 |
(byte*)tmp, raster); |
65 |
@@ -232,15 +246,71 @@ |
66 |
|
67 |
/* Write Band Data |
68 |
Because of Scanline compression, extract Scanline compression mode */ |
69 |
- //ul_tiff_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP); |
70 |
- //ul_scan_size = (unsigned long)bmp2run(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP); |
71 |
- //ul_min_size = (ul_scan_size > ul_tiff_size) ? ul_tiff_size : ul_scan_size; |
72 |
+ /*ul_tiff_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP);*/ |
73 |
+ /*ul_scan_size = (unsigned long)bmp2run(obp, ibp, band_height, band_width_bytes, GDI_PRE_COMP);*/ |
74 |
+ /*ul_min_size = (ul_scan_size > ul_tiff_size) ? ul_tiff_size : ul_scan_size;*/ |
75 |
ul_min_size = ul_tiff_size; |
76 |
compression_type = GDI_COMP_MODITIFF; |
77 |
- //compression_type = (ul_scan_size > ul_tiff_size) ? GDI_COMP_MODITIFF : GDI_COMP_SCANLINE; |
78 |
+ /*compression_type = (ul_scan_size > ul_tiff_size) ? GDI_COMP_MODITIFF : GDI_COMP_SCANLINE;*/ |
79 |
switch (compression_type) { |
80 |
case GDI_COMP_MODITIFF: |
81 |
+#define FUDGE_BIG_BANDS |
82 |
+#ifndef FUDGE_BIG_BANDS |
83 |
ul_comp_size = FrameTiffComp(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP); |
84 |
+#else |
85 |
+ { |
86 |
+ /* Very ugly. The printer will hose if the compressed |
87 |
+ band size is over 65536, so we "fudge" the data in |
88 |
+ this case repeatedly until we get what we want. |
89 |
+ |
90 |
+ The fudge algorithm is simple, this is kinda-sorta |
91 |
+ RLE, so we just round groups of bits in groups of |
92 |
+ 2, then 3, then 4, etc until the thing works. */ |
93 |
+#define MAXBAND 0xffff |
94 |
+#define ASSERT(x) |
95 |
+ int fudge=0; |
96 |
+ byte *use_band=ibp; |
97 |
+ do { |
98 |
+ ul_comp_size = FrameTiffComp(obp, use_band, |
99 |
+ band_height, band_width_bytes, |
100 |
+ GDI_REAL_COMP); |
101 |
+ if (ul_comp_size > MAXBAND-8) { |
102 |
+ int f, g, h; |
103 |
+ if (!fudge) { |
104 |
+ ASSERT(use_band == ibp); |
105 |
+ use_band = (byte*)gs_malloc(ul_band_size, 1, "gdi_print_page/fudge"); |
106 |
+ fudge=1; |
107 |
+ } |
108 |
+ memcpy(use_band, ibp, ul_band_size); |
109 |
+ fudge++; |
110 |
+ ASSERT(fudge>=2); |
111 |
+ { |
112 |
+#define FUDGE2(x) ( (((((x)>>6)&0x3)?3:0)<<6) \ |
113 |
+ | (((((x)>>4)&0x3)?3:0)<<4) \ |
114 |
+ | (((((x)>>2)&0x3)?3:0)<<2) \ |
115 |
+ | (((((x)>>0)&0x3)?3:0)) ) |
116 |
+#define FUDGE4(x) ( (((((x)>>4)&0xf)?0xf:0)<<4) \ |
117 |
+ | (((((x)>>0)&0xf)?0xf:0)) ) |
118 |
+#define FUDGE8(x) ( (((((x)>>0)&0xff)?0xf:0)) ) |
119 |
+#define FUDGE(fudge, x) ( (fudge == 2 ? FUDGE2(x) \ |
120 |
+ : fudge == 3 ? FUDGE4(x) \ |
121 |
+ : fudge == 4 ? FUDGE8(x) \ |
122 |
+ : 0 ) ) |
123 |
+ |
124 |
+ for(f=0;f<ul_band_size; f++) { |
125 |
+ use_band[f] = FUDGE(fudge, ibp[f]); |
126 |
+ } |
127 |
+ } |
128 |
+ } |
129 |
+ } while (ul_comp_size > MAXBAND-8); |
130 |
+ oh_well: |
131 |
+ if (fudge > 1) { |
132 |
+ ASSERT(use_band != ibp); |
133 |
+ gs_free(use_band, ul_band_size, 1, "gdi_print_page/fudge"); |
134 |
+ /*fprintf(stderr, "smartgdi: band %d fudge factor is %d\n", i, fudge);*/ |
135 |
+ } |
136 |
+ } |
137 |
+#endif |
138 |
break; |
139 |
case GDI_COMP_SCANLINE: |
140 |
ul_comp_size = bmp2run(obp, ibp, band_height, band_width_bytes, GDI_REAL_COMP); |
141 |
@@ -253,7 +323,7 @@ |
142 |
|
143 |
prn_stream = WriteBandHeader(prn_stream, i, compression_type, (band_width_bytes * 8), |
144 |
band_height, ul_comp_size); |
145 |
- //fprintf(prn_stream, "[%d] band, size : %d\n", i, ul_tiff_size); |
146 |
+ /*fprintf(prn_stream, "[%d] band, size : %d\n", i, ul_tiff_size);*/ |
147 |
fwrite(obp, ul_comp_size, 1, prn_stream); |
148 |
} |
149 |
|
150 |
@@ -271,50 +341,50 @@ |
151 |
unsigned char buffer[300]; |
152 |
int dots_per_inch = (int)pdev->y_pixels_per_inch; |
153 |
|
154 |
- strcpy(buffer, "\x1b%-12345X"); |
155 |
+ strcpy(buffer, "\033%-12345X"); |
156 |
|
157 |
- // Paper Type |
158 |
- strcat(buffer, "@PJL SET PAPERTYPE = NORMAL ON\x0d\x0a"); |
159 |
- //Density |
160 |
- strcat(buffer, "@PJL SET DENSITY = 1\x0d\x0a"); |
161 |
- // Toner Save |
162 |
- strcat(buffer, "@PJL SET TONERSAVE = OFF\x0d\x0a"); |
163 |
- // Enter Language SMART |
164 |
- strcat(buffer, "@PJL ENTER LANGUAGE = SMART\x0d\x0a"); |
165 |
- // JobStart |
166 |
- strcat(buffer, "$PJL JOB START\x0d\x0a"); |
167 |
+ /* Paper Type*/ |
168 |
+ strcat(buffer, "@PJL SET PAPERTYPE = NORMAL ON\015\012"); |
169 |
+ /*Density*/ |
170 |
+ strcat(buffer, "@PJL SET DENSITY = 1\015\012"); |
171 |
+ /* Toner Save*/ |
172 |
+ strcat(buffer, "@PJL SET TONERSAVE = OFF\015\012"); |
173 |
+ /* Enter Language SMART*/ |
174 |
+ strcat(buffer, "@PJL ENTER LANGUAGE = SMART\015\012"); |
175 |
+ /* JobStart*/ |
176 |
+ strcat(buffer, "$PJL JOB START\015\012"); |
177 |
|
178 |
- // Resolution |
179 |
+ /* Resolution*/ |
180 |
if (dots_per_inch == 600) |
181 |
- strcat(buffer, "$PJL RESOLUTION = 600\x0d\x0a"); |
182 |
+ strcat(buffer, "$PJL RESOLUTION = 600\015\012"); |
183 |
else |
184 |
- strcat(buffer, "$PJL RESOLUTION = 300\x0d\x0a"); |
185 |
+ strcat(buffer, "$PJL RESOLUTION = 300\015\012"); |
186 |
|
187 |
- // Copies |
188 |
- strcat(buffer, "$PJL COPIES = 1\x0d\x0a"); |
189 |
- // Paper Size |
190 |
+ /* Copies*/ |
191 |
+ strcat(buffer, "$PJL COPIES = 1\015\012"); |
192 |
+ /* Paper Size*/ |
193 |
switch (gdev_pcl_paper_size((gx_device*)pdev)) |
194 |
{ |
195 |
case PAPER_SIZE_A4: |
196 |
- strcat(buffer, "$PJL PAGE A4 AUTO\x0d\x0a"); |
197 |
+ strcat(buffer, "$PJL PAGE A4 AUTO\015\012"); |
198 |
break; |
199 |
case PAPER_SIZE_LETTER: |
200 |
- strcat(buffer, "$PJL PAGE LETTER AUTO\x0d\x0a"); |
201 |
+ strcat(buffer, "$PJL PAGE LETTER AUTO\015\012"); |
202 |
break; |
203 |
case PAPER_SIZE_LEGAL: |
204 |
- strcat(buffer, "$PJL PAGE LEGAL AUTO\x0d\x0a"); |
205 |
+ strcat(buffer, "$PJL PAGE LEGAL AUTO\015\012"); |
206 |
break; |
207 |
default: |
208 |
- strcat(buffer, "$PJL PAGE LETTER AUTO\x0d\x0a"); |
209 |
+ strcat(buffer, "$PJL PAGE LETTER AUTO\015\012"); |
210 |
break; |
211 |
} |
212 |
- // bitmap start |
213 |
- strcat(buffer, "$PJL BITMAP START\x0d\x0a"); |
214 |
- // write buffer to file. |
215 |
+ /* bitmap start*/ |
216 |
+ strcat(buffer, "$PJL BITMAP START\015\012"); |
217 |
+ /* write buffer to file.*/ |
218 |
ulSize = strlen(buffer); |
219 |
fwrite(buffer, 1, ulSize, fp ); |
220 |
return(fp); |
221 |
-} // WritePJLHeaderData() |
222 |
+} /* WritePJLHeaderData() */ |
223 |
|
224 |
|
225 |
FILE *WriteBandHeader |
226 |
@@ -335,33 +405,33 @@ |
227 |
|
228 |
ulBandSize += 8; |
229 |
|
230 |
- // bandsize |
231 |
+ /* bandsize*/ |
232 |
buf[i++] = (unsigned char)((ulBandSize >> 24) & 0xff); |
233 |
buf[i++] = (unsigned char)((ulBandSize >> 16) & 0xff); |
234 |
buf[i++] = (unsigned char)((ulBandSize >> 8) & 0xff); |
235 |
buf[i++] = (unsigned char)(ulBandSize & 0xff); |
236 |
|
237 |
- // id |
238 |
+ /* id */ |
239 |
buf[i++] = (unsigned char)((usBandNo >> 8) & 0xff); |
240 |
buf[i++] = (unsigned char)(usBandNo & 0xff); |
241 |
|
242 |
- // compress mode |
243 |
+ /* compress mode */ |
244 |
buf[i++] = (unsigned char)(ubCompMode & 0xff); |
245 |
|
246 |
- // ubLeft |
247 |
+ /* ubLeft */ |
248 |
buf[i++] = (unsigned char)(ubLeft & 0xff); |
249 |
|
250 |
- // height |
251 |
+ /* height*/ |
252 |
buf[i++] = (unsigned char)((usBandHeight >> 8) & 0xff); |
253 |
buf[i++] = (unsigned char)(usBandHeight & 0xff); |
254 |
|
255 |
- // width |
256 |
+ /* width */ |
257 |
buf[i++] = (unsigned char)((usBandWidth >> 8) & 0xff); |
258 |
buf[i++] = (unsigned char)(usBandWidth & 0xff); |
259 |
|
260 |
fwrite(buf, 1, i, fp); |
261 |
return(fp); |
262 |
-} // end of WriteBandHeader() |
263 |
+} /* end of WriteBandHeader()*/ |
264 |
|
265 |
FILE *WriteTrailerData(FILE *fp) |
266 |
{ |
267 |
@@ -369,18 +439,18 @@ |
268 |
unsigned long buffer[200]; |
269 |
|
270 |
memset((char*)buffer, 0x00, 200); |
271 |
- strcpy((char*)buffer, "$PJL PRINT 4\x0d\x0a"); |
272 |
- strcat((char*)buffer, "$PJL EOJ\x0d\x0a"); |
273 |
- strcat((char*)buffer, "$PJL SYNC\x0d\x0a"); |
274 |
- strcat((char*)buffer, "$PJL RELEASE 0 2047\x0d\x0a"); |
275 |
- strcat((char*)buffer, "$PJL GARBAGE\x0d\x0a"); |
276 |
- strcat((char*)buffer, "\x1b%-12345X\x0d\x0a"); |
277 |
+ strcpy((char*)buffer, "$PJL PRINT 4\015\012"); |
278 |
+ strcat((char*)buffer, "$PJL EOJ\015\012"); |
279 |
+ strcat((char*)buffer, "$PJL SYNC\015\012"); |
280 |
+ strcat((char*)buffer, "$PJL RELEASE 0 2047\015\012"); |
281 |
+ strcat((char*)buffer, "$PJL GARBAGE\015\012"); |
282 |
+ strcat((char*)buffer, "\033%-12345X\015\012"); |
283 |
|
284 |
ulSize = strlen((char*)buffer); |
285 |
fwrite(buffer, 1, ulSize, fp); |
286 |
|
287 |
return(fp); |
288 |
-} // WriteTrailerData() |
289 |
+} /* WriteTrailerData()*/ |
290 |
|
291 |
unsigned long FrameTiffComp(unsigned char *pubDest, |
292 |
unsigned char *pubSrc, |
293 |
@@ -399,7 +469,7 @@ |
294 |
|
295 |
for (i = 0; i < usTotalLines; i++) |
296 |
{ |
297 |
- if (!(ubMode & 0x02)) // |
298 |
+ if (!(ubMode & 0x02)) |
299 |
{ |
300 |
usLineSize = FrameTiff_Comp(SrcPtr, TgtPtr, usBytesPerLine); |
301 |
} |
302 |
@@ -416,7 +486,7 @@ |
303 |
ulret += usLineSize; |
304 |
} |
305 |
|
306 |
- if (!(ubMode & 0x02)) // |
307 |
+ if (!(ubMode & 0x02)) |
308 |
{ |
309 |
switch (ulret%4) |
310 |
{ |
311 |
@@ -448,7 +518,7 @@ |
312 |
} |
313 |
} |
314 |
return(ulret); |
315 |
-} // FrameTiffComp() |
316 |
+} /* FrameTiffComp()*/ |
317 |
|
318 |
unsigned int FrameTiff_Comp(unsigned char *lpSrcBuf, unsigned char *lpTgtBuf, unsigned int nSrcBytes) |
319 |
{ |
320 |
@@ -528,13 +598,13 @@ |
321 |
usEndCnt = 16384; |
322 |
} |
323 |
usEndCnt = usCount - 2; |
324 |
- // usEndCnt = usCount - 2; original |
325 |
- // 19990824 by LSM : for end file while (usEndCnt--) |
326 |
+ /* usEndCnt = usCount - 2; original*/ |
327 |
+ /* 19990824 by LSM : for end file while (usEndCnt--)*/ |
328 |
while (usEndCnt--) |
329 |
{ |
330 |
/* read next data */ |
331 |
ubFirst = ubSecond; |
332 |
- ubSecond = *pubSrc++; // read 3rd Data |
333 |
+ ubSecond = *pubSrc++; /* read 3rd Data*/ |
334 |
if (ubFirst == ubSecond) |
335 |
{ |
336 |
if (usEndCnt <= 1) |
337 |
@@ -544,7 +614,7 @@ |
338 |
} |
339 |
else |
340 |
{ |
341 |
- ubSecond = *pubSrc++; // read 4th Data |
342 |
+ ubSecond = *pubSrc++; /* read 4th Data*/ |
343 |
usEndCnt--; |
344 |
if (ubFirst == ubSecond) |
345 |
{ |
346 |
@@ -660,14 +730,14 @@ |
347 |
{ |
348 |
usEndCnt = 16384; |
349 |
} |
350 |
- // usEndCnt = usCount - 2; |
351 |
+ /* usEndCnt = usCount - 2;*/ |
352 |
usEndCnt = usCount - 2; |
353 |
- // 19990824 by LSM : for Last file while (usEndCnt--) |
354 |
+ /* 19990824 by LSM : for Last file while (usEndCnt--)*/ |
355 |
while (usEndCnt--) |
356 |
{ |
357 |
/* read next data */ |
358 |
ubFirst = ubSecond; |
359 |
- ubSecond = *pubSrc++; // read 3rd Data |
360 |
+ ubSecond = *pubSrc++; /* read 3rd Data*/ |
361 |
if (ubFirst == ubSecond) |
362 |
{ |
363 |
if (usEndCnt <= 1) |
364 |
@@ -677,8 +747,8 @@ |
365 |
} |
366 |
else |
367 |
{ |
368 |
- ubSecond = *pubSrc++; // read 4th Data |
369 |
- usEndCnt--; // 19990824 by LSM |
370 |
+ ubSecond = *pubSrc++; /* read 4th Data*/ |
371 |
+ usEndCnt--; /* 19990824 by LSM*/ |
372 |
if (ubFirst == ubSecond) |
373 |
{ |
374 |
ubMisCnt = 3; |
375 |
@@ -691,7 +761,7 @@ |
376 |
/* save data */ |
377 |
usControl = (unsigned int) (pubSrc - pubOrg); |
378 |
usControl -= ubMisCnt; |
379 |
- // 19990824 by LSM : for fixing GPF on Photoshop |
380 |
+ /* 19990824 by LSM : for fixing GPF on Photoshop*/ |
381 |
if (usControl > usCount) |
382 |
{ |
383 |
usControl = usCount; |
384 |
@@ -728,77 +798,77 @@ |
385 |
} sc_tbl; |
386 |
|
387 |
static sc_tbl gdi_ScanTbl[256] = { |
388 |
-{ 8, 0, 0 }, { 7, 1, 1 }, { 6, 1, 0 }, { 6, 2, 1 }, // 0x00 |
389 |
+{ 8, 0, 0 }, { 7, 1, 1 }, { 6, 1, 0 }, { 6, 2, 1 }, /* 0x00*/ |
390 |
{ 5, 1, 0 }, { 0, 0, 1 }, { 5, 2, 0 }, { 5, 3, 1 }, |
391 |
{ 4, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
392 |
{ 4, 2, 0 }, { 0, 0, 1 }, { 4, 3, 0 }, { 4, 4, 1 }, |
393 |
-{ 3, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x10 |
394 |
+{ 3, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x10*/ |
395 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
396 |
{ 3, 2, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
397 |
{ 3, 3, 0 }, { 0, 0, 1 }, { 3, 4, 0 }, { 3, 5, 1 }, |
398 |
-{ 2, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x20 |
399 |
+{ 2, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x20*/ |
400 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
401 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0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, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xd0*/ |
455 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
456 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
457 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
458 |
-{ 0, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xe0 |
459 |
+{ 0, 3, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xe0*/ |
460 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
461 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
462 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
463 |
-{ 0, 4, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0xf0 |
464 |
+{ 0, 4, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0xf0*/ |
465 |
{ 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
466 |
{ 0, 5, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, |
467 |
{ 0, 6, 0 }, { 0, 0, 1 }, { 0, 7, 0 }, { 0, 8, 1 }, |
468 |
}; |
469 |
|
470 |
static sc_tbl gdi_ScanTbl4[16] = { |
471 |
-{ 4, 0, 0 }, { 3, 1, 1 }, { 2, 1, 0 }, { 2, 2, 1 }, // 0x00 |
472 |
-{ 1, 1, 0 }, { 0, 0, 1 }, { 1, 2, 0 }, { 1, 3, 1 }, // 0x04 |
473 |
-{ 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, // 0x08 |
474 |
-{ 0, 2, 0 }, { 0, 0, 1 }, { 0, 3, 0 }, { 0, 4, 1 } // 0x0c |
475 |
+{ 4, 0, 0 }, { 3, 1, 1 }, { 2, 1, 0 }, { 2, 2, 1 }, /* 0x00*/ |
476 |
+{ 1, 1, 0 }, { 0, 0, 1 }, { 1, 2, 0 }, { 1, 3, 1 }, /* 0x04*/ |
477 |
+{ 0, 1, 0 }, { 0, 0, 1 }, { 0, 0, 0 }, { 0, 0, 1 }, /* 0x08*/ |
478 |
+{ 0, 2, 0 }, { 0, 0, 1 }, { 0, 3, 0 }, { 0, 4, 1 } /* 0x0c*/ |
479 |
}; |
480 |
|
481 |
long SaveScanData( unsigned char *, unsigned short, unsigned short, unsigned short, unsigned short, unsigned short ); |
482 |
@@ -816,32 +886,32 @@ |
483 |
lWarp = (long)(usWarp << 3); |
484 |
lDis = ((long)usDy * lWarp) + (long)sDx; |
485 |
|
486 |
- // 1st, 2nd, 3rd & 4th byte |
487 |
- ultmp_dat = 0xc0000000; |
488 |
+ /* 1st, 2nd, 3rd & 4th byte*/ |
489 |
+ ultmp_dat = 0xc0000000ul; |
490 |
if (lDis < 0) |
491 |
{ |
492 |
- ultmp_dat |= 0x20000000; |
493 |
+ ultmp_dat |= 0x20000000ul; |
494 |
} |
495 |
- ultmp_dat |= (lDis & 0x1fffffff); |
496 |
- *out_buf++ = (unsigned char)((ultmp_dat & 0xff000000) >> 24); |
497 |
- *out_buf++ = (unsigned char)((ultmp_dat & 0xff0000) >> 16); |
498 |
- *out_buf++ = (unsigned char)((ultmp_dat & 0xff00) >> 8); |
499 |
- *out_buf++ = (unsigned char)(ultmp_dat & 0xff); |
500 |
+ ultmp_dat |= (lDis & 0x1ffffffful); |
501 |
+ *out_buf++ = (unsigned char)((ultmp_dat & 0xff000000ul) >> 24); |
502 |
+ *out_buf++ = (unsigned char)((ultmp_dat & 0xff0000ul) >> 16); |
503 |
+ *out_buf++ = (unsigned char)((ultmp_dat & 0xff00ul) >> 8); |
504 |
+ *out_buf++ = (unsigned char)(ultmp_dat & 0xfful); |
505 |
|
506 |
- // 5th & 6th byte |
507 |
+ /* 5th & 6th byte*/ |
508 |
ustmp_dat = 0xc000; |
509 |
ustmp_dat |= (usRl & 0x3fff); |
510 |
*out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8); |
511 |
*out_buf++ = (unsigned char)(ustmp_dat & 0xff); |
512 |
|
513 |
return(6); |
514 |
-} // Save6Bytes() |
515 |
+} /* Save6Bytes()*/ |
516 |
|
517 |
long Save4Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx) |
518 |
{ |
519 |
unsigned short ustmp_dat; |
520 |
|
521 |
- // 1st & 2nd byte |
522 |
+ /* 1st & 2nd byte*/ |
523 |
ustmp_dat = 0x8000; |
524 |
if (sDx < 0) |
525 |
{ |
526 |
@@ -851,7 +921,7 @@ |
527 |
*out_buf++ = (unsigned char)((ustmp_dat & 0xff00) >> 8); |
528 |
*out_buf++ = (unsigned char)(ustmp_dat & 0xff); |
529 |
|
530 |
- // 3rd & 4th byte |
531 |
+ /* 3rd & 4th byte*/ |
532 |
ustmp_dat = 0x8000; |
533 |
ustmp_dat |= ((usDy & 0x03) << 12); |
534 |
ustmp_dat |= (usRl & 0xfff); |
535 |
@@ -859,13 +929,13 @@ |
536 |
*out_buf++ = (unsigned char)(ustmp_dat & 0xff); |
537 |
|
538 |
return(4); |
539 |
-} // end of Save4Bytes() |
540 |
+} /* end of Save4Bytes()*/ |
541 |
|
542 |
long Save2Bytes(unsigned char *out_buf, unsigned short usDy, unsigned short usRl, short sDx) |
543 |
{ |
544 |
unsigned char ubtmp_dat; |
545 |
|
546 |
- // 1st byte |
547 |
+ /* 1st byte*/ |
548 |
ubtmp_dat = 0x00; |
549 |
if (usDy == 1) |
550 |
{ |
551 |
@@ -874,7 +944,7 @@ |
552 |
ubtmp_dat |= (usRl & 0x3f); |
553 |
*out_buf++ = ubtmp_dat; |
554 |
|
555 |
- // 2nd byte |
556 |
+ /* 2nd byte*/ |
557 |
if (sDx < 0) |
558 |
{ |
559 |
ubtmp_dat = 0x80; |
560 |
@@ -886,7 +956,7 @@ |
561 |
ubtmp_dat |= ((unsigned char)sDx & 0x7f); |
562 |
*out_buf++ = ubtmp_dat; |
563 |
return(2); |
564 |
-} // end of Save2Bytes() |
565 |
+} /* end of Save2Bytes()*/ |
566 |
|
567 |
long SaveScanData (unsigned char *out_buf, |
568 |
unsigned short us1Cnt, |
569 |
@@ -900,26 +970,26 @@ |
570 |
|
571 |
sDisX = (int)usPosX01 - (int)usPosX10; |
572 |
|
573 |
- // 48 bit |
574 |
+ /* 48 bit*/ |
575 |
if ( (usDy > 3) || (us1Cnt > 4095) ) |
576 |
{ |
577 |
Save6Bytes(out_buf, usDy, us1Cnt, sDisX, usWarp); |
578 |
lRet = 6; |
579 |
} |
580 |
- // 32 bit |
581 |
+ /* 32 bit*/ |
582 |
else if ( (usDy > 1) || (us1Cnt > 63) || (sDisX > 127) || (sDisX < -128) ) |
583 |
{ |
584 |
Save4Bytes(out_buf, usDy, us1Cnt, sDisX); |
585 |
lRet = 4; |
586 |
} |
587 |
- // 16 bit |
588 |
+ /* 16 bit*/ |
589 |
else |
590 |
{ |
591 |
Save2Bytes(out_buf, usDy, us1Cnt, sDisX); |
592 |
lRet = 2; |
593 |
} |
594 |
return(lRet); |
595 |
-} // end of SaveScanData() |
596 |
+} /* end of SaveScanData()*/ |
597 |
|
598 |
|
599 |
long UpdateScanSize (unsigned char *out_buf, |
600 |
@@ -934,23 +1004,23 @@ |
601 |
|
602 |
sDisX = usPosX01 - usPosX10; |
603 |
|
604 |
- // 48 bit |
605 |
+ /* 48 bit*/ |
606 |
if ( (usDy > 3) || (us1Cnt > 4095) ) |
607 |
{ |
608 |
lRet = 6; |
609 |
} |
610 |
- // 32 bit |
611 |
+ /* 32 bit*/ |
612 |
else if ( (usDy > 1) || (us1Cnt > 63) || (sDisX > 127) || (sDisX < -128) ) |
613 |
{ |
614 |
lRet = 4; |
615 |
} |
616 |
- // 16 bit |
617 |
+ /* 16 bit*/ |
618 |
else |
619 |
{ |
620 |
lRet = 2; |
621 |
} |
622 |
return(lRet); |
623 |
-} // end of UpdateScanSize() by bglee 19981224 |
624 |
+} /* end of UpdateScanSize() by bglee 19981224*/ |
625 |
|
626 |
long GetSimpleScan(unsigned char *out_buf, |
627 |
unsigned char ubSizeMode, |
628 |
@@ -983,10 +1053,10 @@ |
629 |
} |
630 |
|
631 |
|
632 |
- // 1 X 1 X |
633 |
+ /* 1 X 1 X*/ |
634 |
if (ubPreBit) |
635 |
{ |
636 |
- // 1 0 1 X |
637 |
+ /* 1 0 1 X*/ |
638 |
if (ubDx) |
639 |
{ |
640 |
lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); |
641 |
@@ -994,23 +1064,23 @@ |
642 |
*usPosX01 = usBytePos + ubDx; |
643 |
*us1Count = ubRl; |
644 |
*usDy = 0; |
645 |
- // 1 0 1 0 |
646 |
+ /* 1 0 1 0*/ |
647 |
if (!ubLastBit) |
648 |
{ |
649 |
- // 19990330 by bglee |
650 |
+ /* 19990330 by bglee*/ |
651 |
out_buf = out_buf + lScanSize; |
652 |
|
653 |
lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); |
654 |
*usPosX10 = *usPosX01 ; |
655 |
*us1Count = 0; |
656 |
} |
657 |
- // 1 0 1 1 |
658 |
+ /* 1 0 1 1*/ |
659 |
} |
660 |
- // 1 1 1 X |
661 |
+ /* 1 1 1 X*/ |
662 |
else |
663 |
{ |
664 |
*us1Count += ubRl; |
665 |
- // 1 1 1 0 |
666 |
+ /* 1 1 1 0*/ |
667 |
if (!ubLastBit) |
668 |
{ |
669 |
lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); |
670 |
@@ -1018,16 +1088,16 @@ |
671 |
*us1Count = 0; |
672 |
*usDy = 0; |
673 |
} |
674 |
- // 1 1 1 1 |
675 |
+ /* 1 1 1 1*/ |
676 |
} |
677 |
} |
678 |
- // 0 X 1 X |
679 |
+ /* 0 X 1 X*/ |
680 |
else |
681 |
{ |
682 |
- // 0 X 1 X |
683 |
+ /* 0 X 1 X*/ |
684 |
*usPosX01 = usBytePos + ubDx; |
685 |
*us1Count += ubRl; |
686 |
- // 0 X 1 0 |
687 |
+ /* 0 X 1 0*/ |
688 |
if (!ubLastBit) |
689 |
{ |
690 |
lScanSize += (*UpdateScanLine[ubSizeMode])(out_buf, *us1Count, *usDy, *usPosX10, *usPosX01, usWidth); |
691 |
@@ -1035,11 +1105,11 @@ |
692 |
*us1Count = 0; |
693 |
*usDy = 0; |
694 |
} |
695 |
- // 0 X 1 1 |
696 |
+ /* 0 X 1 1*/ |
697 |
} |
698 |
|
699 |
return(lScanSize); |
700 |
-} // end of GetSimpleScan() |
701 |
+} /* end of GetSimpleScan() */ |
702 |
|
703 |
|
704 |
long scan_map (unsigned char *in_buf, |
705 |
@@ -1049,7 +1119,7 @@ |
706 |
unsigned char ubMode) |
707 |
{ |
708 |
unsigned int i, j, k; |
709 |
- unsigned char ubPreBit, ubCrtByte;//, ubLastBit; |
710 |
+ unsigned char ubPreBit, ubCrtByte;/*, ubLastBit;*/ |
711 |
long lScanSize, lTmp; |
712 |
long lCrtSize; |
713 |
unsigned short us1Count; |
714 |
@@ -1078,7 +1148,7 @@ |
715 |
switch (ubCrtByte) |
716 |
{ |
717 |
case 0x00: |
718 |
- // 1 0 |
719 |
+ /* 1 0 */ |
720 |
if (ubPreBit) |
721 |
{ |
722 |
lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); |
723 |
@@ -1088,16 +1158,16 @@ |
724 |
us1Count = 0; |
725 |
usDy = 0; |
726 |
} |
727 |
- // 0 0 |
728 |
+ /* 0 0*/ |
729 |
break; |
730 |
|
731 |
case 0xff: |
732 |
- // 1 1 |
733 |
+ /* 1 1*/ |
734 |
if (ubPreBit) |
735 |
{ |
736 |
us1Count += 8; |
737 |
} |
738 |
- // 0 1 |
739 |
+ /* 0 1*/ |
740 |
else |
741 |
{ |
742 |
us1Count = 8; |
743 |
@@ -1106,7 +1176,7 @@ |
744 |
break; |
745 |
|
746 |
default: |
747 |
- // X X 1 X |
748 |
+ /* X X 1 X*/ |
749 |
if (gdi_ScanTbl[ubCrtByte].ubRl) |
750 |
{ |
751 |
usBytePos = (j << 3); |
752 |
@@ -1114,7 +1184,7 @@ |
753 |
out_buf = out_buf + lTmp; |
754 |
lScanSize += lTmp; |
755 |
} |
756 |
- // complex pattern |
757 |
+ /* complex pattern*/ |
758 |
else |
759 |
{ |
760 |
for (k = 0; k < 2; k++) |
761 |
@@ -1124,7 +1194,7 @@ |
762 |
switch (ubTemp) |
763 |
{ |
764 |
case 0x00: |
765 |
- // 1 0 |
766 |
+ /* 1 0*/ |
767 |
if (ubPreBit) |
768 |
{ |
769 |
lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); |
770 |
@@ -1134,16 +1204,16 @@ |
771 |
us1Count = 0; |
772 |
usDy = 0; |
773 |
} |
774 |
- // 0 0 |
775 |
+ /* 0 0*/ |
776 |
break; |
777 |
|
778 |
case 0x0f: |
779 |
- // 1 1 |
780 |
+ /* 1 1*/ |
781 |
if (ubPreBit) |
782 |
{ |
783 |
us1Count += 4; |
784 |
} |
785 |
- // 0 1 |
786 |
+ /* 0 1*/ |
787 |
else |
788 |
{ |
789 |
us1Count = 4; |
790 |
@@ -1152,7 +1222,7 @@ |
791 |
break; |
792 |
|
793 |
case 0x05: |
794 |
- // 1 0101 |
795 |
+ /* 1 0101*/ |
796 |
if (ubPreBit) |
797 |
{ |
798 |
lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, us1Count, usDy, usPosX10, usPosX01, usWidth); |
799 |
@@ -1162,13 +1232,13 @@ |
800 |
usPosX10 = usBytePos - us1Count; |
801 |
usDy = 0; |
802 |
} |
803 |
- // 0 0101 |
804 |
+ /* 0 0101*/ |
805 |
usPosX01 = usBytePos + 1; |
806 |
lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, 1, usDy, usPosX10, usPosX01, usWidth); |
807 |
out_buf = out_buf + lTmp; |
808 |
lScanSize += lTmp; |
809 |
|
810 |
- // next |
811 |
+ /* next*/ |
812 |
usPosX10 = 0; |
813 |
usPosX01 = 2; |
814 |
usDy = 0; |
815 |
@@ -1176,12 +1246,12 @@ |
816 |
break; |
817 |
|
818 |
case 0x09: |
819 |
- // 1 1001 |
820 |
+ /* 1 1001*/ |
821 |
if (ubPreBit) |
822 |
{ |
823 |
us1Count++; |
824 |
} |
825 |
- // 0 1001 |
826 |
+ /* 0 1001*/ |
827 |
else |
828 |
{ |
829 |
usPosX01 = usBytePos; |
830 |
@@ -1191,7 +1261,7 @@ |
831 |
out_buf = out_buf + lTmp; |
832 |
lScanSize += lTmp; |
833 |
|
834 |
- // next |
835 |
+ /* next*/ |
836 |
if (ubPreBit) |
837 |
{ |
838 |
usPosX10 = usBytePos - us1Count + 1; |
839 |
@@ -1207,12 +1277,12 @@ |
840 |
break; |
841 |
|
842 |
case 0x0a: |
843 |
- // 1 1010 |
844 |
+ /* 1 1010*/ |
845 |
if (ubPreBit) |
846 |
{ |
847 |
us1Count++; |
848 |
} |
849 |
- // 0 1010 |
850 |
+ /* 0 1010*/ |
851 |
else |
852 |
{ |
853 |
us1Count = 1; |
854 |
@@ -1222,25 +1292,25 @@ |
855 |
out_buf = out_buf + lTmp; |
856 |
lScanSize += lTmp; |
857 |
|
858 |
- // next |
859 |
+ /* next*/ |
860 |
usPosX10 = usBytePos - us1Count + 1; |
861 |
usPosX01 = usBytePos + 2; |
862 |
lTmp = (*UpdateScanLine[ubSizeMode])(out_buf, 1, 0, usPosX10, usPosX01, usWidth); |
863 |
out_buf = out_buf + lTmp; |
864 |
lScanSize += lTmp; |
865 |
- // next |
866 |
+ /* next*/ |
867 |
usPosX10 = usBytePos + 2; |
868 |
usDy = 0; |
869 |
us1Count = 0; |
870 |
break; |
871 |
|
872 |
case 0x0b: |
873 |
- // 1 1011 |
874 |
+ /* 1 1011*/ |
875 |
if (ubPreBit) |
876 |
{ |
877 |
us1Count++; |
878 |
} |
879 |
- // 0 1011 |
880 |
+ /* 0 1011*/ |
881 |
else |
882 |
{ |
883 |
us1Count = 1; |
884 |
@@ -1250,7 +1320,7 @@ |
885 |
out_buf = out_buf + lTmp; |
886 |
lScanSize += lTmp; |
887 |
|
888 |
- // next |
889 |
+ /* next*/ |
890 |
if (ubPreBit) |
891 |
{ |
892 |
usPosX10 = usBytePos - us1Count + 1; |
893 |
@@ -1267,12 +1337,12 @@ |
894 |
break; |
895 |
|
896 |
case 0x0d: |
897 |
- // 1 1101 |
898 |
+ /* 1 1101*/ |
899 |
if (ubPreBit) |
900 |
{ |
901 |
us1Count += 2; |
902 |
} |
903 |
- // 0 1101 |
904 |
+ /* 0 1101*/ |
905 |
else |
906 |
{ |
907 |
us1Count = 2; |
908 |
@@ -1282,7 +1352,7 @@ |
909 |
out_buf = out_buf + lTmp; |
910 |
lScanSize += lTmp; |
911 |
|
912 |
- // next |
913 |
+ /* next*/ |
914 |
if (ubPreBit) |
915 |
{ |
916 |
usPosX10 = usBytePos - us1Count + 2; |
917 |
@@ -1298,17 +1368,17 @@ |
918 |
break; |
919 |
|
920 |
default: |
921 |
- // X X 1 X |
922 |
+ /* X X 1 X*/ |
923 |
lTmp = GetSimpleScan(out_buf, ubSizeMode, &us1Count, &usDy, &usPosX10, &usPosX01, usBytePos, ubTemp, 4, ubPreBit, usWidth); |
924 |
out_buf = out_buf + lTmp; |
925 |
lScanSize += lTmp; |
926 |
break; |
927 |
- } // end of switch() |
928 |
+ } /* end of switch()*/ |
929 |
ubPreBit = ubTemp & 0x01; |
930 |
- } // end of k-loop |
931 |
+ } /* end of k-loop*/ |
932 |
} |
933 |
break; |
934 |
- } // end of switch() |
935 |
+ } /* end of switch()*/ |
936 |
|
937 |
ubPreBit = ubCrtByte & 0x01; |
938 |
} /*for usWidth */ |
939 |
@@ -1326,7 +1396,7 @@ |
940 |
} |
941 |
usDy++; |
942 |
|
943 |
- // check size over |
944 |
+ /* check size over*/ |
945 |
if ( (i % 5) == 4 ) |
946 |
{ |
947 |
lCrtSize = (long)((long)usWidth * (long)(i + 1)); |
948 |
@@ -1342,7 +1412,7 @@ |
949 |
lScanSize = -1; |
950 |
} |
951 |
return(lScanSize); |
952 |
-} // end of scan_map() |
953 |
+} /* end of scan_map() */ |
954 |
|
955 |
/***************************************************************** |
956 |
* H : bmp2run |
957 |
@@ -1362,7 +1432,7 @@ |
958 |
unsigned char *tmp_buf1, *tmp_buf2; |
959 |
long scan_size; |
960 |
|
961 |
- //return(-1); // 19990323 by bglee - request from SM Lee |
962 |
+ /*return(-1);*/ /* 19990323 by bglee - request from SM Lee*/ |
963 |
|
964 |
tmp_buf1 = in_buf; |
965 |
tmp_buf2 = out_buf; |
966 |
@@ -1372,7 +1442,7 @@ |
967 |
return(-1); |
968 |
} |
969 |
|
970 |
- if ( !(ubMode & 0x02) ) // real compression //--- |
971 |
+ if ( !(ubMode & 0x02) ) /* real compression */ |
972 |
{ |
973 |
out_buf = tmp_buf2 + scan_size; |
974 |
*out_buf++ = 0x00; |
975 |
@@ -1385,7 +1455,7 @@ |
976 |
scan_size += 2; |
977 |
} |
978 |
} |
979 |
- else // pre-compression |
980 |
+ else /* pre-compression*/ |
981 |
{ |
982 |
scan_size += 2; |
983 |
if (scan_size % 4) |