ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/glare.h
Revision: 2.3
Committed: Sat Feb 22 02:07:30 2003 UTC (21 years, 1 month ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 2.2: +1 -4 lines
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# User Rev Content
1 greg 2.3 /* RCSid: $Id$ */
2 greg 1.1 /*
3     * Common data structures for glare source finding routines
4     */
5    
6     #include "standard.h"
7     #include "view.h"
8     #include "color.h"
9     #include "setscan.h"
10    
11 greg 1.14 #define GLAREBR 7.0 /* glare source is this * avg. lum. */
12 greg 1.1
13 greg 1.17 #define SAMPDENS 75 /* default samples per unit in image */
14 greg 1.1 #define TSAMPSTEP 10 /* sample step to compute threshold */
15    
16 greg 1.13 #define SEPS 1 /* sources this close ==> contig. */
17 greg 1.1
18 greg 1.8 #define SAMIN .005 /* minimum solid angle for source */
19     #define MAXBUDDY (4.*sqrt(SAMIN/PI)) /* max separation for pairing */
20    
21     #define TOOSMALL(s) ((s)->brt*(s)->dom < threshold*SAMIN)
22 greg 1.17
23     #define SABIG .025 /* solid angle of splittable source */
24 greg 2.2 #define LCORR .12 /* linearity of splittable source */
25 greg 1.8
26 greg 1.1 extern VIEW ourview; /* our view */
27     extern VIEW pictview; /* picture view */
28     extern VIEW leftview, rightview; /* leftmost and rightmost views */
29    
30     extern int verbose; /* verbose reporting */
31     extern char *progname; /* global argv[0] */
32    
33 greg 1.7 extern double threshold; /* threshold value for glare sources */
34    
35 greg 1.4 extern int sampdens; /* sample density */
36 greg 1.1 extern ANGLE glarang[]; /* glare calculation angles */
37     extern int nglarangs;
38 greg 1.2 extern double maxtheta; /* maximum glare angle (in radians) */
39 greg 1.1 extern int hsize; /* horizontal size */
40    
41     #define nglardirs (2*nglarangs+1)
42 greg 1.5 #define vsize (sampdens-1)
43 greg 1.16 #define hscale(v) sqrt((double)(sampdens*sampdens - (v)*(v)))
44     #define hlim(v) (int)(maxtheta*hscale(v))
45     #define h_theta(h,v) (-(h)/hscale(v))
46 greg 1.1
47     extern struct illum {
48     float theta; /* glare direction */
49     float lcos, lsin; /* cosine and sine to left view */
50     float rcos, rsin; /* cosine and sine to right view */
51     double sum; /* sum of indirect luminances */
52 greg 1.10 double n; /* number of values in sum */
53 greg 1.1 } *indirect; /* array of indirect illuminances */
54    
55     struct srcspan {
56     short v; /* vertical position */
57     short l, r; /* left and right horizontal limits */
58     float brsum; /* sum of brightnesses for this span */
59     struct srcspan *next; /* next source span in list */
60     };
61    
62     extern struct source {
63     FVECT dir; /* source direction */
64 greg 1.6 double dom; /* solid angle of source */
65     double brt; /* average source brightness */
66 greg 1.1 struct srcspan *first; /* first span for this source */
67     struct source *next; /* next source in list */
68     } *donelist; /* finished sources */
69 greg 1.14
70 greg 1.1 extern double getviewpix();
71 greg 1.15 extern double pixsize();
72 greg 1.11
73     extern long npixinvw; /* number of samples in view */
74     extern long npixmiss; /* number of samples missing */