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

Comparing ray/src/util/glaresrc.c (file contents):
Revision 2.4 by greg, Sat Feb 22 02:07:30 2003 UTC vs.
Revision 2.5 by schorsch, Fri Jan 2 12:51:54 2004 UTC

# Line 14 | Line 14 | static const char      RCSid[] = "$Id$";
14   struct source   *curlist = NULL;        /* current source list */
15   struct source   *donelist = NULL;       /* finished sources */
16  
17 + static struct srcspan * newspan(int     l, int  r, int  v, float        *sb);
18 + static struct srcspan * newspan(int     l, int  r, int  v, float        *sb);
19 + static void addindirect(int     h, int  v, double       br);
20 + static void addsrcspan(struct srcspan   *nss);
21 + static void mergesource(struct source   *sp, struct source      *ap);
22 + static void close_sources(int   v);
23 + static void close_allsrcs(void);
24 + static struct srcspan * splitspan(register struct srcspan       *sso, double    h, double       v, double       m);
25 + static struct source * splitsource(struct source        *so);
26 + static void donesource(register struct source   *sp);
27 + static struct source * findbuddy(register struct source *s, register struct source      *l);
28 + static void absorb(register struct source       *s);
29 + static void freespans(struct source     *sp);
30  
31 < struct srcspan *
32 < newspan(l, r, v, sb)            /* allocate a new source span */
33 < int     l, r, v;
34 < float   *sb;
31 >
32 > static struct srcspan *
33 > newspan(                /* allocate a new source span */
34 >        int     l,
35 >        int     r,
36 >        int     v,
37 >        float   *sb
38 > )
39   {
40          register struct srcspan *ss;
41          register int    i;
# Line 36 | Line 53 | float  *sb;
53   }
54  
55  
56 < analyze()                       /* analyze our scene */
56 > extern void
57 > analyze(void)                   /* analyze our scene */
58   {
59          int     h, v;
60          int     left;
# Line 83 | Line 101 | analyze()                      /* analyze our scene */
101   }
102  
103  
104 < addindirect(h, v, br)           /* add brightness to indirect illuminances */
105 < int     h, v;
106 < double  br;
104 > static void
105 > addindirect(            /* add brightness to indirect illuminances */
106 >        int     h,
107 >        int     v,
108 >        double  br
109 > )
110   {
111          double  tanb, d;
112          int     hl;
# Line 131 | Line 152 | double br;
152   }
153  
154  
155 < comp_thresh()                   /* compute glare threshold */
155 > extern void
156 > comp_thresh(void)                       /* compute glare threshold */
157   {
158          int     h, v;
159          int     nsamps;
# Line 170 | Line 192 | comp_thresh()                  /* compute glare threshold */
192   }
193  
194  
195 < addsrcspan(nss)                 /* add new source span to our list */
196 < struct srcspan  *nss;
195 > static void
196 > addsrcspan(                     /* add new source span to our list */
197 >        struct srcspan  *nss
198 > )
199   {
200          struct source   *last, *cs, *this;
201          register struct srcspan *ss;
# Line 208 | Line 232 | struct srcspan *nss;
232   }
233  
234  
235 < mergesource(sp, ap)             /* merge source ap into source sp */
236 < struct source   *sp, *ap;
235 > static void
236 > mergesource(            /* merge source ap into source sp */
237 >        struct source   *sp,
238 >        struct source   *ap
239 > )
240   {
241          struct srcspan  head;
242          register struct srcspan *alp, *prev, *tp;
# Line 242 | Line 269 | struct source  *sp, *ap;
269   }
270  
271  
272 < close_sources(v)                /* close sources above v */
273 < int     v;
272 > static void
273 > close_sources(          /* close sources above v */
274 >        int     v
275 > )
276   {
277          struct source   head;
278          register struct source  *last, *this;
# Line 261 | Line 290 | int    v;
290   }
291  
292  
293 < close_allsrcs()                 /* done with everything */
293 > static void
294 > close_allsrcs(void)                     /* done with everything */
295   {
296          register struct source  *this, *next;
297  
# Line 275 | Line 305 | close_allsrcs()                        /* done with everything */
305   }
306  
307  
308 < struct srcspan *
309 < splitspan(sso, h, v, m)         /* divide source span at point */
310 < register struct srcspan *sso;
311 < double  h, v, m;
308 > static struct srcspan *
309 > splitspan(              /* divide source span at point */
310 >        register struct srcspan *sso,
311 >        double  h,
312 >        double  v,
313 >        double  m
314 > )
315   {
316          register struct srcspan *ssn;
317          double  d;
# Line 303 | Line 336 | double h, v, m;
336   }
337  
338  
339 < struct source *
340 < splitsource(so)                 /* divide source in two if it's big and long */
341 < struct source   *so;
339 > static struct source *
340 > splitsource(                    /* divide source in two if it's big and long */
341 >        struct source   *so
342 > )
343   {
344          LRSUM   lr;
345          LRLIN   fit;
# Line 355 | Line 389 | struct source  *so;
389   }
390  
391  
392 < donesource(sp)                  /* finished with this source */
393 < register struct source  *sp;
392 > static void
393 > donesource(                     /* finished with this source */
394 >        register struct source  *sp
395 > )
396   {
397          struct source   *newsrc;
398          register struct srcspan *ss;
# Line 396 | Line 432 | register struct source *sp;
432   }
433  
434  
435 < struct source *
436 < findbuddy(s, l)                 /* find close enough source to s in l*/
437 < register struct source  *s, *l;
435 > static struct source *
436 > findbuddy(                      /* find close enough source to s in l*/
437 >        register struct source  *s,
438 >        register struct source  *l
439 > )
440   {
441          struct source   *bestbuddy = NULL;
442          double  d, r, mindist = MAXBUDDY;
# Line 415 | Line 453 | register struct source *s, *l;
453   }
454  
455  
456 < absorb_specks()                 /* eliminate too-small sources */
456 > extern void
457 > absorb_specks(void)                     /* eliminate too-small sources */
458   {
459          struct source   head, *buddy;
460          register struct source  *last, *this;
# Line 439 | Line 478 | absorb_specks()                        /* eliminate too-small sources */
478   }
479  
480  
481 < absorb(s)                       /* absorb a source into indirect */
482 < register struct source  *s;
481 > static void
482 > absorb(                 /* absorb a source into indirect */
483 >        register struct source  *s
484 > )
485   {
486          FVECT   dir;
487          double  d;
# Line 459 | Line 500 | register struct source *s;
500   }
501  
502  
503 < freespans(sp)                   /* free spans associated with source */
504 < struct source   *sp;
503 > static void
504 > freespans(                      /* free spans associated with source */
505 >        struct source   *sp
506 > )
507   {
508          register struct srcspan *ss;
509  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines