1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* colortab.c - allocate and control dynamic color table. |
6 |
|
* |
11 |
|
* histogram is cleared. This algorithm |
12 |
|
* performs only as well as the next drawing's color |
13 |
|
* distribution is correlated to the last. |
14 |
+ |
* |
15 |
+ |
* External symbols declared in drvier.h |
16 |
|
*/ |
17 |
|
|
18 |
+ |
#include "copyright.h" |
19 |
+ |
|
20 |
|
#include "standard.h" |
21 |
|
|
22 |
|
#include "color.h" |
56 |
|
/* initial color cube boundary */ |
57 |
|
static int CLRCUBE[3][2] = {{0,NRED},{0,NGRN},{0,NBLU}}; |
58 |
|
|
59 |
< |
static int split(), cut(); |
59 |
> |
static int split(); |
60 |
> |
static void cut(); |
61 |
|
|
62 |
|
|
63 |
|
int |
70 |
|
return(0); |
71 |
|
/* free old tables */ |
72 |
|
if (clrtab != NULL) |
73 |
< |
free((char *)clrtab); |
73 |
> |
free((void *)clrtab); |
74 |
|
if (ctree != NULL) |
75 |
< |
free((char *)ctree); |
75 |
> |
free((void *)ctree); |
76 |
|
/* get new tables */ |
77 |
|
for (treesize = 1; treesize < ncolors; treesize <<= 1) |
78 |
|
; |
93 |
|
int |
94 |
|
get_pixel(col, set_pixel) /* get pixel for color */ |
95 |
|
COLOR col; |
96 |
< |
int (*set_pixel)(); |
96 |
> |
void (*set_pixel)(); |
97 |
|
{ |
96 |
– |
extern char errmsg[]; |
98 |
|
int r, g, b; |
99 |
|
int cv[3]; |
100 |
|
register CNODE *tp; |
144 |
|
} |
145 |
|
|
146 |
|
|
147 |
+ |
void |
148 |
|
make_gmap(gam) /* make gamma correction map */ |
149 |
|
double gam; |
150 |
|
{ |
157 |
|
} |
158 |
|
|
159 |
|
|
160 |
+ |
void |
161 |
|
set_cmap(rmap, gmap, bmap) /* set custom color correction map */ |
162 |
|
BYTE *rmap, *gmap, *bmap; |
163 |
|
{ |
167 |
|
} |
168 |
|
|
169 |
|
|
170 |
+ |
void |
171 |
|
map_color(rgb, col) /* map a color to a byte triplet */ |
172 |
|
BYTE rgb[3]; |
173 |
|
COLOR col; |
178 |
|
} |
179 |
|
|
180 |
|
|
181 |
< |
static |
181 |
> |
static void |
182 |
|
cut(tree, level, box, c0, c1) /* partition color space */ |
183 |
|
register CNODE *tree; |
184 |
|
int level; |