1 |
< |
/* Copyright (c) 1989 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
33 |
|
(int)(colval(c,p)*256.) : 255 ] |
34 |
|
/* color partition tree */ |
35 |
|
#define CNODE short |
36 |
< |
#define set_branch(p,c) ((c)<<2|(p)) |
36 |
> |
#define set_branch(p,c) ((c)<<2|(p)) |
37 |
|
#define set_pval(pv) ((pv)<<2|3) |
38 |
|
#define is_branch(cn) (((cn)&3)!=3) |
39 |
|
#define is_pval(cn) (((cn)&3)==3) |
128 |
|
(g-clrtab[h].ent[GRN])*(g-clrtab[h].ent[GRN]) + |
129 |
|
(b-clrtab[h].ent[BLU])*(b-clrtab[h].ent[BLU]) > MAXDST2) { |
130 |
|
clrtab[h].ent[RED] = r; |
131 |
< |
clrtab[h].ent[GRN] = g; /* reassign pixel */ |
131 |
> |
clrtab[h].ent[GRN] = g; /* reassign pixel */ |
132 |
|
clrtab[h].ent[BLU] = b; |
133 |
|
#ifdef DEBUG |
134 |
|
sprintf(errmsg, "pixel %d = (%d,%d,%d) (%d refs)\n", |
142 |
|
|
143 |
|
|
144 |
|
make_gmap(gam) /* make gamma correction map */ |
145 |
< |
double gam; |
145 |
> |
double gam; |
146 |
|
{ |
147 |
– |
extern double pow(); |
147 |
|
register int i; |
148 |
|
|
149 |
|
for (i = 0; i < 256; i++) |