ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/biq.c
(Generate patch)

Comparing ray/src/px/biq.c (file contents):
Revision 1.2 by greg, Thu Feb 2 14:10:31 1989 UTC vs.
Revision 2.2 by greg, Sat Feb 22 02:07:27 2003 UTC

# Line 1 | Line 1
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  
# Line 31 | Line 29 | colormap cm;           /* quantization colormap */
29  
30      draw_grey(ocm);
31  
32 <    bcopy(color,cm,sizeof color);
32 >    bcopy((char *)color,(char *)cm,sizeof color);
33   }
34  
35   /*----------------------------------------------------------------------*/
# Line 41 | Line 39 | colormap ocm;
39   {
40      register rgbpixel *linin;
41      register pixel *linout;
42 +    rgbpixel intmp;
43 +    int outtmp;
44      int y;
45      register int x;
46  
# Line 50 | Line 50 | colormap ocm;
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   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines