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 2.3 by greg, Tue Sep 8 10:04:33 1992 UTC vs.
Revision 2.5 by gregl, Wed Jan 21 12:55:00 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4 < static char SCCSid[] = "$SunId$ LBL";
4 > static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
# Line 20 | Line 20 | static BYTE    *g_mant = NULL, *g_nexp = NULL;
20  
21   static BYTE     (*g_bval)[256] = NULL;
22  
23 + #ifndef pow
24   extern double   pow();
25 + #endif
26  
27  
28   setcolrcor(f, a2)               /* set brightness correction */
# Line 58 | Line 60 | double a2;
60                                          /* compute gamb -> colr mapping */
61          i = 0;
62          mult = 256.0;
63 <        for (j = 255; j > 0; j--) {
64 <                while ((g_mant[j] = mult * (*f)(j/256.0, a2)) < 128) {
63 >        for (j = 256; j--; ) {
64 >                while ((g_mant[j] = mult * (*f)((j+.5)/256.0, a2)) < 128) {
65                          i++;
66                          mult *= 2.0;
67                  }
68                  g_nexp[j] = i;
69          }
68        g_mant[0] = 0;
69        g_nexp[0] = COLXS;
70          return(0);
71   }
72  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines