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

Comparing ray/src/hd/rhd_ctab.c (file contents):
Revision 3.4 by schorsch, Mon Jun 30 14:59:11 2003 UTC vs.
Revision 3.5 by schorsch, Thu Jan 1 11:21:55 2004 UTC

# Line 19 | Line 19 | static const char      RCSid[] = "$Id$";
19   #include <string.h>
20  
21   #include "standard.h"
22 + #include "rhdisp.h"
23   #include "color.h"
24                                  /* histogram resolution */
25   #define NRED            24
# Line 51 | Line 52 | static unsigned short  histo[NRED][NGRN][NBLU];
52                                  /* initial color cube boundary */
53   static int      CLRCUBE[3][2] = {{0,NRED},{0,NGRN},{0,NBLU}};
54  
55 < static int      split(), cut();
55 > static void cut(CNODE *tree, int level, int box[3][2], int c0, int c1);
56 > static int split(int box[3][2]);
57  
58  
59 < int
60 < new_ctab(ncolors)               /* start new color table with max ncolors */
61 < int     ncolors;
59 >
60 > extern int
61 > new_ctab(               /* start new color table with max ncolors */
62 >        int     ncolors
63 > )
64   {
65          int     treesize;
66  
# Line 84 | Line 88 | int    ncolors;
88   }
89  
90  
91 < int
92 < get_pixel(rgb, set_pixel)       /* get pixel for color */
93 < BYTE    rgb[3];
94 < int     (*set_pixel)();
91 > extern int
92 > get_pixel(      /* get pixel for color */
93 >        BYTE    rgb[3],
94 >        void    (*set_pixel)(int h, int r, int g, int b)
95 > )
96   {
92        extern char     errmsg[];
97          int     r, g, b;
98          int     cv[3];
99          register CNODE  *tp;
# Line 129 | Line 133 | int    (*set_pixel)();
133                  clrtab[h].ent[GRN] = g; /* reassign pixel */
134                  clrtab[h].ent[BLU] = b;
135   #ifdef DEBUG
136 <                sprintf(errmsg, "pixel %d = (%d,%d,%d) (%d refs)\n",
137 <                                h, r, g, b, clrtab[h].n);
138 <                eputs(errmsg);
136 >                {
137 >                        extern char     errmsg[];
138 >                        sprintf(errmsg, "pixel %d = (%d,%d,%d) (%d refs)\n",
139 >                                        h, r, g, b, clrtab[h].n);
140 >                        eputs(errmsg);
141 >                }
142   #endif
143                  (*set_pixel)(h, r, g, b);
144          }
# Line 139 | Line 146 | int    (*set_pixel)();
146   }
147  
148  
149 < static
150 < cut(tree, level, box, c0, c1)           /* partition color space */
151 < register CNODE  *tree;
152 < int     level;
153 < register int    box[3][2];
154 < int     c0, c1;
149 > static void
150 > cut(            /* partition color space */
151 >        register CNODE  *tree,
152 >        int     level,
153 >        register int    box[3][2],
154 >        int     c0,
155 >        int     c1
156 > )
157   {
158          int     kb[3][2];
159          
# Line 166 | Line 175 | int    c0, c1;
175  
176  
177   static int
178 < split(box)                              /* find median cut for box */
179 < register int    box[3][2];
178 > split(                          /* find median cut for box */
179 >        register int    box[3][2]
180 > )
181   {
182   #define c0      r
183          register int    r, g, b;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines