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

Comparing ray/src/util/glare.h (file contents):
Revision 1.3 by greg, Mon Mar 18 15:06:30 1991 UTC vs.
Revision 1.14 by greg, Fri Apr 12 10:28:39 1991 UTC

# Line 11 | Line 11
11   #include "color.h"
12   #include "setscan.h"
13  
14 < #define GLAREBR         10.0            /* glare source is this * avg. lum. */
14 > #define GLAREBR         7.0             /* glare source is this * avg. lum. */
15  
16 < #define SAMPDENS        50              /* samples per unit in image */
16 > #define SAMPDENS        50              /* default samples per unit in image */
17   #define TSAMPSTEP       10              /* sample step to compute threshold */
18  
19 < #define SEPS            2               /* sources this close ==> contig. */
19 > #define SEPS            1               /* sources this close ==> contig. */
20  
21 + #define SAMIN           .005            /* minimum solid angle for source */
22 + #define MAXBUDDY        (4.*sqrt(SAMIN/PI))     /* max separation for pairing */
23 +
24 + #define TOOSMALL(s)     ((s)->brt*(s)->dom < threshold*SAMIN)
25 +
26   extern VIEW     ourview;                /* our view */
27   extern VIEW     pictview;               /* picture view */
28   extern VIEW     leftview, rightview;    /* leftmost and rightmost views */
# Line 25 | Line 30 | extern VIEW    leftview, rightview;    /* leftmost and right
30   extern int      verbose;                /* verbose reporting */
31   extern char     *progname;              /* global argv[0] */
32  
33 + extern double   threshold;              /* threshold value for glare sources */
34 +
35 + extern int      sampdens;               /* sample density */
36   extern ANGLE    glarang[];              /* glare calculation angles */
37   extern int      nglarangs;
38   extern double   maxtheta;               /* maximum glare angle (in radians) */
# Line 32 | Line 40 | extern int     hsize;                  /* horizontal size */
40   extern int      hlim;                   /* horizontal limit of central view */
41  
42   #define nglardirs       (2*nglarangs+1)
43 < #define vsize           SAMPDENS
44 < #define h_theta(h)      ((double)(h)/-(double)SAMPDENS)
43 > #define vsize           (sampdens-1)
44 > #define h_theta(h)      (-(double)(h)/(double)sampdens)
45  
46   extern struct illum {
47          float   theta;          /* glare direction */
48          float   lcos, lsin;     /* cosine and sine to left view */
49          float   rcos, rsin;     /* cosine and sine to right view */
50          double  sum;            /* sum of indirect luminances */
51 <        int     n;              /* number of values in sum */
51 >        double  n;              /* number of values in sum */
52   } *indirect;            /* array of indirect illuminances */
53  
54   struct srcspan {
# Line 52 | Line 60 | struct srcspan {
60  
61   extern struct source {
62          FVECT   dir;            /* source direction */
63 <        float   dom;            /* solid angle of source */
64 <        float   brt;            /* average source brightness */
63 >        double  dom;            /* solid angle of source */
64 >        double  brt;            /* average source brightness */
65          struct srcspan  *first; /* first span for this source */
66          struct source   *next;  /* next source in list */
67   } *donelist;                    /* finished sources */
68  
69 + typedef struct {
70 +        double  err;            /* cumulative error */
71 +        double  prob;           /* target probability */
72 + } SPANERR;              /* probability record for computing spans */
73 +
74   extern double   getviewpix();
75 +
76 + extern long     npixinvw;       /* number of samples in view */
77 + extern long     npixmiss;       /* number of samples missing */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines