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.9 by greg, Mon Jun 30 19:04:29 2003 UTC vs.
Revision 2.12 by greg, Fri May 20 02:06:38 2011 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9  
10   #include <stdio.h>
11   #include <math.h>
12 +
13 + #include "rtmisc.h"
14   #include "color.h"
15  
14 extern char     *bmalloc();
16  
17   #define MAXGSHIFT       31              /* maximum shift for gamma table */
18  
19 < static BYTE     *g_mant = NULL, *g_nexp = NULL;
19 > static uby8     *g_mant = NULL, *g_nexp = NULL;
20  
21 < static BYTE     (*g_bval)[256] = NULL;
21 > static uby8     (*g_bval)[256] = NULL;
22  
23  
24   int
25   setcolrcor(f, a2)               /* set brightness correction */
26 < double  (*f)();
26 > double  (*f)(double,double);
27   double  a2;
28   {
29          double  mult;
30          register int    i, j;
31                                          /* allocate tables */
32          if (g_bval == NULL && (g_bval =
33 <                        (BYTE (*)[256])bmalloc((MAXGSHIFT+1)*256)) == NULL)
33 >                        (uby8 (*)[256])bmalloc((MAXGSHIFT+1)*256)) == NULL)
34                  return(-1);
35                                          /* compute colr -> gamb mapping */
36          mult = 1.0/256.0;
# Line 44 | Line 45 | double a2;
45  
46   int
47   setcolrinv(f, a2)               /* set inverse brightness correction */
48 < double  (*f)();
48 > double  (*f)(double,double);
49   double  a2;
50   {
51          double  mult;
52          register int    i, j;
53                                          /* allocate tables */
54 <        if (g_mant == NULL && (g_mant = (BYTE *)bmalloc(256)) == NULL)
54 >        if (g_mant == NULL && (g_mant = (uby8 *)bmalloc(256)) == NULL)
55                  return(-1);
56 <        if (g_nexp == NULL && (g_nexp = (BYTE *)bmalloc(256)) == NULL)
56 >        if (g_nexp == NULL && (g_nexp = (uby8 *)bmalloc(256)) == NULL)
57                  return(-1);
58                                          /* compute gamb -> colr mapping */
59          i = 0;
# Line 135 | Line 136 | int    len;
136   {
137          register int    nexpo;
138  
139 <        if (g_mant == NULL | g_nexp == NULL)
139 >        if ((g_mant == NULL) | (g_nexp == NULL))
140                  return(-1);
141          while (len-- > 0) {
142                  nexpo = g_nexp[scan[0][RED]];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines