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 2.4 by schorsch, Mon Jun 30 14:59:12 2003 UTC vs.
Revision 2.5 by schorsch, Sun Mar 28 20:33:13 2004 UTC

# Line 25 | Line 25 | int n;                 /* number of colors in it */
25   #define ERRMAX 20       /* maximum allowed propagated error,
26                             if >=255 then no clamping */
27  
28 + static void sample(colormap ocm);
29 + static void convertmap(colormap in, colormap out);
30 + static void draw_nodith(colormap ocm);
31 + static void draw_dith(colormap ocm);
32 +
33 +
34   /*----------------------------------------------------------------------*/
35  
36 < ciq(dith,nw,synth,cm)
37 < int dith;               /* is dithering desired? 0=no, 1=yes */
38 < int nw;                 /* number of colors wanted in output image */
39 < int synth;              /* synthesize colormap? 0=no, 1=yes */
40 < colormap cm;            /* quantization colormap */
41 <                        /* read if synth=0; always written */
36 > void
37 > ciq(
38 >        int dith,               /* is dithering desired? 0=no, 1=yes */
39 >        int nw,                 /* number of colors wanted in output image */
40 >        int synth,              /* synthesize colormap? 0=no, 1=yes */
41 >        colormap cm             /* quantization colormap */
42 > )                       /* read if synth=0; always written */
43   {
44      int na,i;
45      colormap ocm;
# Line 66 | Line 73 | colormap cm;           /* quantization colormap */
73  
74   /*----------------------------------------------------------------------*/
75  
76 < sample(ocm)             /* make color frequency table (histogram) */
77 < colormap ocm;
76 > static void
77 > sample(         /* make color frequency table (histogram) */
78 >        colormap ocm
79 > )
80   {
81      register int x,y;
82      register rgbpixel *lp;
# Line 88 | Line 97 | colormap ocm;
97      free((void *)line);
98   }
99  
100 < convertmap(in,out)              /* convert to shifted color map */
101 < register colormap in,out;
100 > static void
101 > convertmap(             /* convert to shifted color map */
102 >        register colormap in,
103 >        register colormap out
104 > )
105   {
106      register int j;
107  
# Line 100 | Line 112 | register colormap in,out;
112      }
113   }
114  
115 < draw_nodith(ocm)        /* quantize without dithering */
116 < colormap ocm;                   /* colormap for orig */
115 > static void
116 > draw_nodith(    /* quantize without dithering */
117 >        colormap ocm                    /* colormap for orig */
118 > )
119   {
120      register int x,y;
121      register rgbpixel *lp;
# Line 123 | Line 137 | colormap ocm;                  /* colormap for orig */
137      free((void *)oline);
138   }
139  
140 < draw_dith(ocm)                  /* quantize with dithering */
141 < colormap ocm;                   /* colormap for orig */
140 > static void
141 > draw_dith(                      /* quantize with dithering */
142 >        colormap ocm                    /* colormap for orig */
143 > )
144   {
145      register int *p,*q,rr,gg,bb,v,x,y,*P,*Q,*R;
146      int *buf;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines