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

Comparing ray/src/common/colrops.c (file contents):
Revision 1.1 by greg, Fri Oct 19 16:33:44 1990 UTC vs.
Revision 1.2 by greg, Fri Oct 19 21:31:54 1990 UTC

# Line 10 | Line 10 | static char SCCSid[] = "$SunId$ LBL";
10  
11   #include "color.h"
12  
13 < #define MAXGSHIFT       2               /* maximum shift for gamma table */
13 > #define MAXGSHIFT       4               /* maximum shift for gamma table */
14  
15   static BYTE     g_mant[256], g_nexp[256];
16  
# Line 32 | Line 32 | double g;
32                                          /* compute gamb -> colr mapping */
33          i = 0;
34          mult = 256.0;
35 <        for (j = 255; j >= 0; j--) {
36 <        rept:
37 <                g_mant[j] = mult * pow((j+.5)/256.0, g);
38 <                if (g_mant[j] < 128) {
35 >        for (j = 255; j > 0; j--) {
36 >                while ((g_mant[j] = mult * pow(j/256.0, g)) < 128) {
37                          i++;
38                          mult *= 2.0;
41                        goto rept;
39                  }
40                  g_nexp[j] = i;
41          }
42 +        g_mant[0] = 0;
43 +        g_nexp[0] = COLXS;
44   }
45  
46  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines