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.1 by greg, Thu Feb 2 10:49:06 1989 UTC vs.
Revision 2.4 by schorsch, Mon Jun 30 14:59:12 2003 UTC

# Line 1 | Line 1
1 /*
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
4 + /*
5   *  biq.c - simple greyscale quantization.
6   *
7   *      9/19/88
8   */
9  
10 + #include <string.h>
11 +
12 + #include "standard.h"
13   #include "ciq.h"
14  
15  
# Line 29 | Line 31 | colormap cm;           /* quantization colormap */
31  
32      draw_grey(ocm);
33  
34 <    bcopy(color,cm,sizeof color);
34 >    memcpy((void *)cm,(void *)color,sizeof color);
35   }
36  
37   /*----------------------------------------------------------------------*/
# Line 39 | Line 41 | colormap ocm;
41   {
42      register rgbpixel *linin;
43      register pixel *linout;
44 +    rgbpixel intmp;
45 +    int outtmp;
46      int y;
47      register int x;
48  
# Line 48 | Line 52 | colormap ocm;
52      for (y = 0; y < ymax; y++) {
53          picreadline3(y, linin);
54          for (x = 0; x < xmax; x++) {
55 <                linin[x].r = ocm[0][linin[x].r];
56 <                linin[x].g = ocm[1][linin[x].g];
57 <                linin[x].b = ocm[2][linin[x].b];
58 <                linout[x] = rgb_bright(&linin[x]);
59 <                linout[x] = (linout[x]*n+n/2)/256;
55 >                intmp.r = ocm[0][linin[x].r];
56 >                intmp.g = ocm[1][linin[x].g];
57 >                intmp.b = ocm[2][linin[x].b];
58 >                outtmp = rgb_bright(&intmp);
59 >                linout[x] = (outtmp*n+n/2)/256;
60          }
61          picwriteline(y, linout);
62      }
63 <    free((char *)linin);
64 <    free((char *)linout);
63 >    free((void *)linin);
64 >    free((void *)linout);
65   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines