1 |
– |
/* Copyright (c) 1994 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 |
|
* Neural-Net quantization algorithm based on work of Anthony Dekker |
6 |
|
*/ |
7 |
|
|
8 |
< |
#include "standard.h" |
8 |
> |
#include "copyright.h" |
9 |
|
|
10 |
< |
#include "color.h" |
10 |
> |
#include <string.h> |
11 |
|
|
12 |
+ |
#include "standard.h" |
13 |
+ |
#include "color.h" |
14 |
|
#include "random.h" |
15 |
|
|
16 |
|
#ifdef COMPAT_MODE |
50 |
|
|
51 |
|
#define setskip(sp,n) ((sp)[0]=(n)>>16,(sp)[1]=((n)>>8)&255,(sp)[2]=(n)&255) |
52 |
|
|
53 |
+ |
static cpyclrtab(); |
54 |
|
|
55 |
+ |
|
56 |
|
neu_init(npixels) /* initialize our sample array */ |
57 |
|
long npixels; |
58 |
|
{ |
133 |
|
cpyclrtab(); |
134 |
|
inxbuild(); |
135 |
|
/* we're done with our samples */ |
136 |
< |
free((char *)thesamples); |
136 |
> |
free((void *)thesamples); |
137 |
|
/* reset dithering function */ |
138 |
|
neu_dith_colrs((BYTE *)NULL, (COLR *)NULL, 0); |
139 |
|
/* return new color table size */ |
173 |
|
|
174 |
|
if (n != N) { /* get error propogation array */ |
175 |
|
if (N) { |
176 |
< |
free((char *)cerr); |
176 |
> |
free((void *)cerr); |
177 |
|
cerr = NULL; |
178 |
|
} |
179 |
|
if (n) |
184 |
|
return; |
185 |
|
} |
186 |
|
N = n; |
187 |
< |
bzero((char *)cerr, 3*N*sizeof(short)); |
187 |
> |
memset((char *)cerr, '\0', 3*N*sizeof(short)); |
188 |
|
} |
189 |
|
err[0] = err[1] = err[2] = 0; |
190 |
|
for (x = 0; x < n; x++) { |