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.6 by greg, Mon May 29 16:47:54 2006 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 + void    pict_stats(void);
18  
19 < struct srcspan *
20 < newspan(l, r, v, sb)            /* allocate a new source span */
21 < int     l, r, v;
22 < float   *sb;
19 > static struct srcspan * newspan(int     l, int  r, int  v, float        *sb);
20 > static struct srcspan * newspan(int     l, int  r, int  v, float        *sb);
21 > static void addindirect(int     h, int  v, double       br);
22 > static void addsrcspan(struct srcspan   *nss);
23 > static void mergesource(struct source   *sp, struct source      *ap);
24 > static void close_sources(int   v);
25 > static void close_allsrcs(void);
26 > static struct srcspan * splitspan(register struct srcspan       *sso, double    h, double       v, double       m);
27 > static struct source * splitsource(struct source        *so);
28 > static void donesource(register struct source   *sp);
29 > static struct source * findbuddy(register struct source *s, register struct source      *l);
30 > static void absorb(register struct source       *s);
31 > static void freespans(struct source     *sp);
32 >
33 >
34 > static struct srcspan *
35 > newspan(                /* allocate a new source span */
36 >        int     l,
37 >        int     r,
38 >        int     v,
39 >        float   *sb
40 > )
41   {
42          register struct srcspan *ss;
43          register int    i;
# Line 36 | Line 55 | float  *sb;
55   }
56  
57  
58 < analyze()                       /* analyze our scene */
58 > extern void
59 > analyze(void)                   /* analyze our scene */
60   {
61          int     h, v;
62          int     left;
# Line 83 | Line 103 | analyze()                      /* analyze our scene */
103   }
104  
105  
106 < addindirect(h, v, br)           /* add brightness to indirect illuminances */
107 < int     h, v;
108 < double  br;
106 > static void
107 > addindirect(            /* add brightness to indirect illuminances */
108 >        int     h,
109 >        int     v,
110 >        double  br
111 > )
112   {
113          double  tanb, d;
114          int     hl;
# Line 131 | Line 154 | double br;
154   }
155  
156  
157 < comp_thresh()                   /* compute glare threshold */
157 > extern void
158 > comp_thresh(void)                       /* compute glare threshold */
159   {
160          int     h, v;
161          int     nsamps;
# Line 170 | Line 194 | comp_thresh()                  /* compute glare threshold */
194   }
195  
196  
197 < addsrcspan(nss)                 /* add new source span to our list */
198 < struct srcspan  *nss;
197 > static void
198 > addsrcspan(                     /* add new source span to our list */
199 >        struct srcspan  *nss
200 > )
201   {
202          struct source   *last, *cs, *this;
203          register struct srcspan *ss;
# Line 208 | Line 234 | struct srcspan *nss;
234   }
235  
236  
237 < mergesource(sp, ap)             /* merge source ap into source sp */
238 < struct source   *sp, *ap;
237 > static void
238 > mergesource(            /* merge source ap into source sp */
239 >        struct source   *sp,
240 >        struct source   *ap
241 > )
242   {
243          struct srcspan  head;
244          register struct srcspan *alp, *prev, *tp;
# Line 242 | Line 271 | struct source  *sp, *ap;
271   }
272  
273  
274 < close_sources(v)                /* close sources above v */
275 < int     v;
274 > static void
275 > close_sources(          /* close sources above v */
276 >        int     v
277 > )
278   {
279          struct source   head;
280          register struct source  *last, *this;
# Line 261 | Line 292 | int    v;
292   }
293  
294  
295 < close_allsrcs()                 /* done with everything */
295 > static void
296 > close_allsrcs(void)                     /* done with everything */
297   {
298          register struct source  *this, *next;
299  
# Line 275 | Line 307 | close_allsrcs()                        /* done with everything */
307   }
308  
309  
310 < struct srcspan *
311 < splitspan(sso, h, v, m)         /* divide source span at point */
312 < register struct srcspan *sso;
313 < double  h, v, m;
310 > static struct srcspan *
311 > splitspan(              /* divide source span at point */
312 >        register struct srcspan *sso,
313 >        double  h,
314 >        double  v,
315 >        double  m
316 > )
317   {
318          register struct srcspan *ssn;
319          double  d;
# Line 303 | Line 338 | double h, v, m;
338   }
339  
340  
341 < struct source *
342 < splitsource(so)                 /* divide source in two if it's big and long */
343 < struct source   *so;
341 > static struct source *
342 > splitsource(                    /* divide source in two if it's big and long */
343 >        struct source   *so
344 > )
345   {
346          LRSUM   lr;
347          LRLIN   fit;
# Line 355 | Line 391 | struct source  *so;
391   }
392  
393  
394 < donesource(sp)                  /* finished with this source */
395 < register struct source  *sp;
394 > static void
395 > donesource(                     /* finished with this source */
396 >        register struct source  *sp
397 > )
398   {
399          struct source   *newsrc;
400          register struct srcspan *ss;
# Line 396 | Line 434 | register struct source *sp;
434   }
435  
436  
437 < struct source *
438 < findbuddy(s, l)                 /* find close enough source to s in l*/
439 < register struct source  *s, *l;
437 > static struct source *
438 > findbuddy(                      /* find close enough source to s in l*/
439 >        register struct source  *s,
440 >        register struct source  *l
441 > )
442   {
443          struct source   *bestbuddy = NULL;
444          double  d, r, mindist = MAXBUDDY;
# Line 415 | Line 455 | register struct source *s, *l;
455   }
456  
457  
458 < absorb_specks()                 /* eliminate too-small sources */
458 > extern void
459 > absorb_specks(void)                     /* eliminate too-small sources */
460   {
461          struct source   head, *buddy;
462          register struct source  *last, *this;
# Line 439 | Line 480 | absorb_specks()                        /* eliminate too-small sources */
480   }
481  
482  
483 < absorb(s)                       /* absorb a source into indirect */
484 < register struct source  *s;
483 > static void
484 > absorb(                 /* absorb a source into indirect */
485 >        register struct source  *s
486 > )
487   {
488          FVECT   dir;
489          double  d;
# Line 459 | Line 502 | register struct source *s;
502   }
503  
504  
505 < freespans(sp)                   /* free spans associated with source */
506 < struct source   *sp;
505 > static void
506 > freespans(                      /* free spans associated with source */
507 >        struct source   *sp
508 > )
509   {
510          register struct srcspan *ss;
511  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines