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.6 by greg, Tue Dec 4 11:25:45 1990 UTC vs.
Revision 2.4 by schorsch, Mon Jun 30 14:59:12 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 <string.h>
14 +
15   #include "standard.h"
16   #include "ciq.h"
17  
# Line 44 | Line 43 | colormap cm;           /* quantization colormap */
43      if (synth)
44          n = makecm(nw,&na);     /* analyze histogram and synthesize colormap */
45      else {
46 <        bcopy((char *)cm,(char *)color,sizeof color);
46 >        memcpy((void *)color,(void *)cm,sizeof color);
47          n = nw;
48          na = 0;
49          for (i=0; i<len; i++) if (hist[i]) na++;
# Line 61 | Line 60 | colormap cm;           /* quantization colormap */
60          draw_nodith(ocm);
61      }
62  
63 <    bcopy((char *)color,(char *)cm,sizeof color);
63 >    memcpy((void *)cm,(void *)color,sizeof color);
64      /*endclosest();*/
65   }
66  
# Line 86 | Line 85 | colormap ocm;
85          for (lp=line, x=0; x<xmax; x++, lp++)
86              table(map,lp->r,lp->g,lp->b)++;
87      }
88 <    free((char *)line);
88 >    free((void *)line);
89   }
90  
91   convertmap(in,out)              /* convert to shifted color map */
# Line 120 | Line 119 | colormap ocm;                  /* colormap for orig */
119              oline[x] = table(map,lp->r,lp->g,lp->b);
120          picwriteline(y,oline);
121      }
122 <    free((char *)iline);
123 <    free((char *)oline);
122 >    free((void *)iline);
123 >    free((void *)oline);
124   }
125  
126   draw_dith(ocm)                  /* quantize with dithering */
# Line 170 | Line 169 | colormap ocm;                  /* colormap for orig */
169          }
170          picwriteline(y,oline);
171      }
172 <    free((char *)iline);
173 <    free((char *)oline);
174 <    free((char *)buf);
172 >    free((void *)iline);
173 >    free((void *)oline);
174 >    free((void *)buf);
175   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines