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.5 by saba, Tue Jul 5 15:49:51 1994 UTC vs.
Revision 2.8 by greg, Sat Jun 21 15:05:01 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1991 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Program to convert lamp color from table and compute radiance.
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  
17 #define PI      3.14159265358979323846
18
19 extern char     *gets(), *strcpy();
20 extern float    *matchlamp();
21
15                                  /* lamp parameters */
16   #define LTYPE           0
17   #define LUNIT           1
# Line 26 | Line 19 | extern float   *matchlamp();
19   #define LOUTP           3
20   #define NPARAMS         4
21  
22 < int     typecheck(), unitcheck(), geomcheck(), outpcheck();
22 > static int typecheck(char *s);
23 > static int unitcheck(char *s);
24 > static int geomcheck(char *s);
25 > static int outpcheck(char *s);
26 > static void compute(void);
27 > static int getpolygon(void), getsphere(void), getcylinder(void), getring(void);
28  
29 +
30   float   *lampcolor;             /* the lamp color (RGB) */
31   double  unit2meter;             /* conversion from units to meters */
32   double  area;                   /* radiating area for this geometry */
# Line 96 | Line 95 | char   *argv[];
95   }
96  
97  
98 < typecheck(s)                    /* check lamp type */
99 < char    *s;
98 > static int
99 > typecheck(                      /* check lamp type */
100 > char    *s
101 > )
102   {
103          lampcolor = matchlamp(s);
104          return(lampcolor != NULL);
105   }
106  
107  
108 < unitcheck(s)                    /* compute conversion to meters */
109 < char    *s;
108 > static int
109 > unitcheck(                      /* compute conversion to meters */
110 > char    *s
111 > )
112   {
113          int     len = strlen(s);
114  
# Line 135 | Line 138 | char   *s;
138   }
139  
140  
141 < geomcheck(s)                    /* check/set lamp geometry */
142 < char    *s;
141 > static int
142 > geomcheck(                      /* check/set lamp geometry */
143 > char    *s
144 > )
145   {
146          int     len = strlen(s);
147  
# Line 162 | Line 167 | char   *s;
167   }
168  
169  
170 < outpcheck(s)                    /* check lumen output value */
171 < register char   *s;
170 > static int
171 > outpcheck(                      /* check lumen output value */
172 > register char   *s
173 > )
174   {
175          if ((*s < '0' || *s > '9') && *s != '.')
176                  return(0);
# Line 172 | Line 179 | register char  *s;
179   }
180  
181  
182 < compute()                       /* compute lamp radiance */
182 > static void
183 > compute(void)                   /* compute lamp radiance */
184   {
185          double  whiteval;
186  
# Line 206 | Line 214 | again:
214   }
215  
216  
217 < getpolygon()                    /* get projected area for a polygon */
217 > static int
218 > getpolygon(void)                        /* get projected area for a polygon */
219   {
220          static double   parea = 1.0;
221  
# Line 217 | Line 226 | getpolygon()                   /* get projected area for a polygon */
226   }
227  
228  
229 < getsphere()                     /* get projected area for a sphere */
229 > static int
230 > getsphere(void)                 /* get projected area for a sphere */
231   {
232          static double   radius = 1.0;
233  
# Line 228 | Line 238 | getsphere()                    /* get projected area for a sphere */
238   }
239  
240  
241 < getcylinder()                   /* get projected area for a cylinder */
241 > static int
242 > getcylinder(void)                       /* get projected area for a cylinder */
243   {
244          static double   length = 1.0, radius = 0.1;
245  
# Line 241 | Line 252 | getcylinder()                  /* get projected area for a cylinder *
252   }
253  
254  
255 < getring()                       /* get projected area for a ring */
255 > static int
256 > getring(void)                   /* get projected area for a ring */
257   {
258          static double   radius = 1.0;
259  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines