43 |
|
static struct tabent { |
44 |
|
long sum[3]; /* sum of colors using this entry */ |
45 |
|
int n; /* number of colors */ |
46 |
< |
BYTE ent[3]; /* current table value */ |
46 |
> |
uby8 ent[3]; /* current table value */ |
47 |
|
} *clrtab = NULL; |
48 |
|
/* color cube partition */ |
49 |
|
static CNODE *ctree = NULL; |
57 |
|
|
58 |
|
|
59 |
|
|
60 |
< |
extern int |
60 |
> |
int |
61 |
|
new_ctab( /* start new color table with max ncolors */ |
62 |
|
int ncolors |
63 |
|
) |
88 |
|
} |
89 |
|
|
90 |
|
|
91 |
< |
extern int |
91 |
> |
int |
92 |
|
get_pixel( /* get pixel for color */ |
93 |
< |
BYTE rgb[3], |
93 |
> |
uby8 rgb[3], |
94 |
|
void (*set_pixel)(int h, int r, int g, int b) |
95 |
|
) |
96 |
|
{ |
97 |
|
int r, g, b; |
98 |
|
int cv[3]; |
99 |
< |
register CNODE *tp; |
100 |
< |
register int h; |
99 |
> |
CNODE *tp; |
100 |
> |
int h; |
101 |
|
/* get desired color */ |
102 |
|
r = rgb[RED]; |
103 |
|
g = rgb[GRN]; |
148 |
|
|
149 |
|
static void |
150 |
|
cut( /* partition color space */ |
151 |
< |
register CNODE *tree, |
151 |
> |
CNODE *tree, |
152 |
|
int level, |
153 |
< |
register int box[3][2], |
153 |
> |
int box[3][2], |
154 |
|
int c0, |
155 |
|
int c1 |
156 |
|
) |
176 |
|
|
177 |
|
static int |
178 |
|
split( /* find median cut for box */ |
179 |
< |
register int box[3][2] |
179 |
> |
int box[3][2] |
180 |
|
) |
181 |
|
{ |
182 |
|
#define c0 r |
183 |
< |
register int r, g, b; |
183 |
> |
int r, g, b; |
184 |
|
int pri; |
185 |
|
long t[HMAX], med; |
186 |
|
/* find dominant axis */ |