--- ray/src/util/glare.h 1991/03/19 09:08:17 1.5 +++ ray/src/util/glare.h 1991/04/12 10:28:39 1.14 @@ -11,13 +11,18 @@ #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 */ + +#define TOOSMALL(s) ((s)->brt*(s)->dom < threshold*SAMIN) + extern VIEW ourview; /* our view */ extern VIEW pictview; /* picture view */ extern VIEW leftview, rightview; /* leftmost and rightmost views */ @@ -25,6 +30,8 @@ extern VIEW leftview, rightview; /* leftmost and right extern int verbose; /* verbose reporting */ extern char *progname; /* global argv[0] */ +extern double threshold; /* threshold value for glare sources */ + extern int sampdens; /* sample density */ extern ANGLE glarang[]; /* glare calculation angles */ extern int nglarangs; @@ -41,7 +48,7 @@ extern struct illum { float lcos, lsin; /* cosine and sine to left view */ float rcos, rsin; /* cosine and sine to right view */ double sum; /* sum of indirect luminances */ - int n; /* number of values in sum */ + double n; /* number of values in sum */ } *indirect; /* array of indirect illuminances */ struct srcspan { @@ -53,10 +60,18 @@ struct srcspan { extern struct source { FVECT dir; /* source direction */ - float dom; /* solid angle of source */ - float brt; /* average source brightness */ + double dom; /* solid angle of source */ + double brt; /* average source brightness */ struct srcspan *first; /* first span for this source */ struct source *next; /* next source in list */ } *donelist; /* finished sources */ +typedef struct { + double err; /* cumulative error */ + double prob; /* target probability */ +} SPANERR; /* probability record for computing spans */ + extern double getviewpix(); + +extern long npixinvw; /* number of samples in view */ +extern long npixmiss; /* number of samples missing */