--- ray/src/util/glare.h 1991/03/21 17:11:48 1.10 +++ ray/src/util/glare.h 1991/04/19 17:41:02 1.15 @@ -6,19 +6,17 @@ * Common data structures for glare source finding routines */ -#define DEBUG 1 - #include "standard.h" #include "view.h" #include "color.h" #include "setscan.h" -#define GLAREBR 10.0 /* glare source is this * avg. lum. */ +#define GLAREBR 7.0 /* glare source is this * avg. lum. */ #define SAMPDENS 50 /* default samples per unit in image */ #define TSAMPSTEP 10 /* sample step to compute threshold */ -#define SEPS 2 /* sources this close ==> contig. */ +#define SEPS 1 /* sources this close ==> contig. */ #define SAMIN .005 /* minimum solid angle for source */ #define MAXBUDDY (4.*sqrt(SAMIN/PI)) /* max separation for pairing */ @@ -39,11 +37,12 @@ extern ANGLE glarang[]; /* glare calculation angles * extern int nglarangs; extern double maxtheta; /* maximum glare angle (in radians) */ extern int hsize; /* horizontal size */ -extern int hlim; /* horizontal limit of central view */ #define nglardirs (2*nglarangs+1) #define vsize (sampdens-1) -#define h_theta(h) (-(double)(h)/(double)sampdens) +#define hscale(v) sqrt(1.-(double)((v)*(v)/(sampdens*sampdens))) +#define hlim(v) (int)(maxtheta*sampdens*hscale(v)) +#define h_theta(h,v) (-(h)/(sampdens*hscale(v))) extern struct illum { float theta; /* glare direction */ @@ -69,3 +68,7 @@ extern struct source { } *donelist; /* finished sources */ extern double getviewpix(); +extern double pixsize(); + +extern long npixinvw; /* number of samples in view */ +extern long npixmiss; /* number of samples missing */