ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/glare.h
Revision: 1.17
Committed: Tue Apr 30 16:24:08 1991 UTC (32 years, 11 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 1.16: +4 -1 lines
Log Message:
added functions for splitting long sources

File Contents

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