1 |
– |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
|
* Allocate and control dynamic color table. |
6 |
|
* |
16 |
|
* except there is no color mapping, since the tm library is used. |
17 |
|
*/ |
18 |
|
|
19 |
+ |
#include <string.h> |
20 |
+ |
|
21 |
|
#include "standard.h" |
22 |
|
#include "color.h" |
23 |
|
/* histogram resolution */ |
64 |
|
return(0); |
65 |
|
/* free old tables */ |
66 |
|
if (clrtab != NULL) |
67 |
< |
free((char *)clrtab); |
67 |
> |
free((void *)clrtab); |
68 |
|
if (ctree != NULL) |
69 |
< |
free((char *)ctree); |
69 |
> |
free((void *)ctree); |
70 |
|
/* get new tables */ |
71 |
|
for (treesize = 1; treesize < ncolors; treesize <<= 1) |
72 |
|
; |
78 |
|
/* partition color space */ |
79 |
|
cut(ctree, 0, CLRCUBE, 0, ncolors); |
80 |
|
/* clear histogram */ |
81 |
< |
bzero((char *)histo, sizeof(histo)); |
81 |
> |
memset((void *)histo, '\0', sizeof(histo)); |
82 |
|
/* return number of colors used */ |
83 |
|
return(ncolors); |
84 |
|
} |
154 |
|
} |
155 |
|
/* split box */ |
156 |
|
*tree = split(box); |
157 |
< |
bcopy((char *)box, (char *)kb, sizeof(kb)); |
157 |
> |
memcpy((void *)kb, (void *)box, sizeof(kb)); |
158 |
|
/* do left (lesser) branch */ |
159 |
|
kb[prim(*tree)][1] = part(*tree); |
160 |
|
cut(tree+(1<<level), level+1, kb, c0, (c0+c1)>>1); |