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

Comparing ray/src/px/ciq.c (file contents):
Revision 1.4 by ph, Fri Apr 7 16:36:12 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   CIQ - main program for color image quantization
6   options for Floyd-Steinberg dithering by minimization of accumulated error
# Line 13 | Line 10 | Paul Heckbert  16 April 82, cleaned up 8 June 86
10   Greg Ward       1 March 88, modified for arbitrary picture sizes
11   */
12  
13 + #include "standard.h"
14   #include "ciq.h"
15  
16   #define table(m,r,g,b) hist[m[0][r]|m[1][g]|m[2][b]]  /* histogram/pvtable */
# Line 43 | Line 41 | colormap cm;           /* quantization colormap */
41      if (synth)
42          n = makecm(nw,&na);     /* analyze histogram and synthesize colormap */
43      else {
44 <        bcopy(cm,color,sizeof color);
44 >        bcopy((char *)cm,(char *)color,sizeof color);
45          n = nw;
46          na = 0;
47          for (i=0; i<len; i++) if (hist[i]) na++;
# Line 60 | Line 58 | colormap cm;           /* quantization colormap */
58          draw_nodith(ocm);
59      }
60  
61 <    bcopy(color,cm,sizeof color);
61 >    bcopy((char *)color,(char *)cm,sizeof color);
62      /*endclosest();*/
63   }
64  
# Line 85 | Line 83 | colormap ocm;
83          for (lp=line, x=0; x<xmax; x++, lp++)
84              table(map,lp->r,lp->g,lp->b)++;
85      }
86 <    free((char *)line);
86 >    free((void *)line);
87   }
88  
89   convertmap(in,out)              /* convert to shifted color map */
# Line 119 | Line 117 | colormap ocm;                  /* colormap for orig */
117              oline[x] = table(map,lp->r,lp->g,lp->b);
118          picwriteline(y,oline);
119      }
120 <    free((char *)iline);
121 <    free((char *)oline);
120 >    free((void *)iline);
121 >    free((void *)oline);
122   }
123  
124   draw_dith(ocm)                  /* quantize with dithering */
# Line 169 | Line 167 | colormap ocm;                  /* colormap for orig */
167          }
168          picwriteline(y,oline);
169      }
170 <    free((char *)iline);
171 <    free((char *)oline);
172 <    free((char *)buf);
170 >    free((void *)iline);
171 >    free((void *)oline);
172 >    free((void *)buf);
173   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines