1 |
– |
/* Copyright 1988 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 |
|
* biq.c - simple greyscale quantization. |
6 |
|
* |
7 |
|
* 9/19/88 |
8 |
|
*/ |
9 |
|
|
10 |
+ |
#include "standard.h" |
11 |
|
#include "ciq.h" |
12 |
|
|
13 |
|
|
29 |
|
|
30 |
|
draw_grey(ocm); |
31 |
|
|
32 |
< |
bcopy(color,cm,sizeof color); |
32 |
> |
bcopy((char *)color,(char *)cm,sizeof color); |
33 |
|
} |
34 |
|
|
35 |
|
/*----------------------------------------------------------------------*/ |
39 |
|
{ |
40 |
|
register rgbpixel *linin; |
41 |
|
register pixel *linout; |
42 |
+ |
rgbpixel intmp; |
43 |
+ |
int outtmp; |
44 |
|
int y; |
45 |
|
register int x; |
46 |
|
|
50 |
|
for (y = 0; y < ymax; y++) { |
51 |
|
picreadline3(y, linin); |
52 |
|
for (x = 0; x < xmax; x++) { |
53 |
< |
linin[x].r = ocm[0][linin[x].r]; |
54 |
< |
linin[x].g = ocm[1][linin[x].g]; |
55 |
< |
linin[x].b = ocm[2][linin[x].b]; |
56 |
< |
linout[x] = rgb_bright(&linin[x]); |
57 |
< |
linout[x] = (linout[x]*n+n/2)/256; |
53 |
> |
intmp.r = ocm[0][linin[x].r]; |
54 |
> |
intmp.g = ocm[1][linin[x].g]; |
55 |
> |
intmp.b = ocm[2][linin[x].b]; |
56 |
> |
outtmp = rgb_bright(&intmp); |
57 |
> |
linout[x] = (outtmp*n+n/2)/256; |
58 |
|
} |
59 |
|
picwriteline(y, linout); |
60 |
|
} |
61 |
< |
free((char *)linin); |
62 |
< |
free((char *)linout); |
61 |
> |
free((void *)linin); |
62 |
> |
free((void *)linout); |
63 |
|
} |