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

Comparing ray/src/rt/colortab.c (file contents):
Revision 1.14 by greg, Thu Mar 29 12:43:07 1990 UTC vs.
Revision 1.15 by greg, Wed Nov 7 17:16:58 1990 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16   *      distribution is correlated to the last.
17   */
18  
19 < #include "color.h"
19 > #include "standard.h"
20  
21 < #define NULL            0
21 > #include "color.h"
22                                  /* histogram resolution */
23   #define NRED            24
24   #define NGRN            32
# Line 43 | Line 43 | static char SCCSid[] = "$SunId$ LBL";
43                                  /* our color table */
44   static struct tabent {
45          long    sum[3];         /* sum of colors using this entry */
46 <        long    n;              /* number of colors */
47 <        short   ent[3];         /* current table value */
46 >        int     n;              /* number of colors */
47 >        BYTE    ent[3];         /* current table value */
48   }       *clrtab = NULL;
49                                  /* color cube partition */
50   static CNODE    *ctree = NULL;
# Line 111 | Line 111 | int    (*set_pixel)();
111                  if (cv[prim(*tp)] < part(*tp))
112                          tp += 1<<h;             /* left branch */
113                  else
114 <                        tp += 1<<(h+1); /* right branch */
114 >                        tp += 1<<(h+1);         /* right branch */
115          h = pval(*tp);
116                                                  /* add to color table */
117          clrtab[h].sum[RED] += r;
# Line 150 | Line 150 | double  gam;
150          for (i = 0; i < 256; i++)
151                  clrmap[RED][i] =
152                  clrmap[GRN][i] =
153 <                clrmap[BLU][i] = 256.0 * pow(i/256.0, 1.0/gam);
153 >                clrmap[BLU][i] = 256.0 * pow((i+0.5)/256.0, 1.0/gam);
154   }
155  
156  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines