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

Comparing ray/src/cv/lampcolor.c (file contents):
Revision 2.6 by greg, Sat Feb 22 02:07:23 2003 UTC vs.
Revision 2.7 by schorsch, Sun Jun 8 12:03:09 2003 UTC

# Line 6 | Line 6 | static const char      RCSid[] = "$Id$";
6   */
7  
8   #include <stdio.h>
9 <
9 > #include <string.h>
10   #include <math.h>
11  
12 + #include "standard.h"
13   #include "color.h"
14  
15   #define PI      3.14159265358979323846
16  
16 extern char     *gets(), *strcpy();
17 extern float    *matchlamp();
18
17                                  /* lamp parameters */
18   #define LTYPE           0
19   #define LUNIT           1
# Line 23 | Line 21 | extern float   *matchlamp();
21   #define LOUTP           3
22   #define NPARAMS         4
23  
24 < int     typecheck(), unitcheck(), geomcheck(), outpcheck();
24 > static int typecheck(char *s);
25 > static int unitcheck(char *s);
26 > static int geomcheck(char *s);
27 > static int outpcheck(char *s);
28 > static void compute(void);
29 > static int getpolygon(void), getsphere(void), getcylinder(void), getring(void);
30  
31 +
32   float   *lampcolor;             /* the lamp color (RGB) */
33   double  unit2meter;             /* conversion from units to meters */
34   double  area;                   /* radiating area for this geometry */
# Line 93 | Line 97 | char   *argv[];
97   }
98  
99  
100 < typecheck(s)                    /* check lamp type */
101 < char    *s;
100 > static int
101 > typecheck(                      /* check lamp type */
102 > char    *s
103 > )
104   {
105          lampcolor = matchlamp(s);
106          return(lampcolor != NULL);
107   }
108  
109  
110 < unitcheck(s)                    /* compute conversion to meters */
111 < char    *s;
110 > static int
111 > unitcheck(                      /* compute conversion to meters */
112 > char    *s
113 > )
114   {
115          int     len = strlen(s);
116  
# Line 132 | Line 140 | char   *s;
140   }
141  
142  
143 < geomcheck(s)                    /* check/set lamp geometry */
144 < char    *s;
143 > static int
144 > geomcheck(                      /* check/set lamp geometry */
145 > char    *s
146 > )
147   {
148          int     len = strlen(s);
149  
# Line 159 | Line 169 | char   *s;
169   }
170  
171  
172 < outpcheck(s)                    /* check lumen output value */
173 < register char   *s;
172 > static int
173 > outpcheck(                      /* check lumen output value */
174 > register char   *s
175 > )
176   {
177          if ((*s < '0' || *s > '9') && *s != '.')
178                  return(0);
# Line 169 | Line 181 | register char  *s;
181   }
182  
183  
184 < compute()                       /* compute lamp radiance */
184 > static void
185 > compute(void)                   /* compute lamp radiance */
186   {
187          double  whiteval;
188  
# Line 203 | Line 216 | again:
216   }
217  
218  
219 < getpolygon()                    /* get projected area for a polygon */
219 > static int
220 > getpolygon(void)                        /* get projected area for a polygon */
221   {
222          static double   parea = 1.0;
223  
# Line 214 | Line 228 | getpolygon()                   /* get projected area for a polygon */
228   }
229  
230  
231 < getsphere()                     /* get projected area for a sphere */
231 > static int
232 > getsphere(void)                 /* get projected area for a sphere */
233   {
234          static double   radius = 1.0;
235  
# Line 225 | Line 240 | getsphere()                    /* get projected area for a sphere */
240   }
241  
242  
243 < getcylinder()                   /* get projected area for a cylinder */
243 > static int
244 > getcylinder(void)                       /* get projected area for a cylinder */
245   {
246          static double   length = 1.0, radius = 0.1;
247  
# Line 238 | Line 254 | getcylinder()                  /* get projected area for a cylinder *
254   }
255  
256  
257 < getring()                       /* get projected area for a ring */
257 > static int
258 > getring(void)                   /* get projected area for a ring */
259   {
260          static double   radius = 1.0;
261  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines