24 |
|
#define neu_dith_colrs dith_colrs |
25 |
|
#endif |
26 |
|
/* our color table (global) */ |
27 |
< |
extern BYTE clrtab[256][3]; |
27 |
> |
extern uby8 clrtab[256][3]; |
28 |
|
static int clrtabsiz; |
29 |
|
|
30 |
|
#ifndef DEFSMPFAC |
36 |
|
/* Samples array starts off holding spacing between adjacent |
37 |
|
* samples, and ends up holding actual BGR sample values. |
38 |
|
*/ |
39 |
< |
static BYTE *thesamples; |
39 |
> |
static uby8 *thesamples; |
40 |
|
static int nsamples; |
41 |
< |
static BYTE *cursamp; |
41 |
> |
static uby8 *cursamp; |
42 |
|
static long skipcount; |
43 |
|
|
44 |
|
#define MAXSKIP (1<<24-1) |
71 |
|
nsamples = npixels/samplefac; |
72 |
|
if (nsamples < 600) |
73 |
|
return(-1); |
74 |
< |
thesamples = (BYTE *)malloc(nsamples*3); |
74 |
> |
thesamples = (uby8 *)malloc(nsamples*3); |
75 |
|
if (thesamples == NULL) |
76 |
|
return(-1); |
77 |
|
cursamp = thesamples; |
100 |
|
|
101 |
|
extern void |
102 |
|
neu_pixel( /* add pixel to our samples */ |
103 |
< |
register BYTE col[] |
103 |
> |
register uby8 col[] |
104 |
|
) |
105 |
|
{ |
106 |
|
if (!skipcount--) { |
148 |
|
/* we're done with our samples */ |
149 |
|
free((void *)thesamples); |
150 |
|
/* reset dithering function */ |
151 |
< |
neu_dith_colrs((BYTE *)NULL, (COLR *)NULL, 0); |
151 |
> |
neu_dith_colrs((uby8 *)NULL, (COLR *)NULL, 0); |
152 |
|
/* return new color table size */ |
153 |
|
return(clrtabsiz); |
154 |
|
} |
156 |
|
|
157 |
|
extern int |
158 |
|
neu_map_pixel( /* get pixel for color */ |
159 |
< |
register BYTE col[] |
159 |
> |
register uby8 col[] |
160 |
|
) |
161 |
|
{ |
162 |
|
return(inxsearch(col[BLU],col[GRN],col[RED])); |
165 |
|
|
166 |
|
extern void |
167 |
|
neu_map_colrs( /* convert a scanline to color index values */ |
168 |
< |
register BYTE *bs, |
168 |
> |
register uby8 *bs, |
169 |
|
register COLR *cs, |
170 |
|
register int n |
171 |
|
) |
179 |
|
|
180 |
|
extern void |
181 |
|
neu_dith_colrs( /* convert scanline to dithered index values */ |
182 |
< |
register BYTE *bs, |
182 |
> |
register uby8 *bs, |
183 |
|
register COLR *cs, |
184 |
|
int n |
185 |
|
) |