--- ray/src/util/glare.h 1991/04/19 17:41:02 1.15 +++ ray/src/util/glare.h 2003/07/14 22:24:00 2.5 @@ -1,19 +1,22 @@ -/* Copyright (c) 1991 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid: $Id: glare.h,v 2.5 2003/07/14 22:24:00 schorsch Exp $ */ /* * Common data structures for glare source finding routines */ +#ifndef _RAD_GLARE_H_ +#define _RAD_GLARE_H_ #include "standard.h" #include "view.h" #include "color.h" #include "setscan.h" +#ifdef __cplusplus +extern "C" { +#endif + #define GLAREBR 7.0 /* glare source is this * avg. lum. */ -#define SAMPDENS 50 /* default samples per unit in image */ +#define SAMPDENS 75 /* default samples per unit in image */ #define TSAMPSTEP 10 /* sample step to compute threshold */ #define SEPS 1 /* sources this close ==> contig. */ @@ -23,6 +26,9 @@ #define TOOSMALL(s) ((s)->brt*(s)->dom < threshold*SAMIN) +#define SABIG .025 /* solid angle of splittable source */ +#define LCORR .12 /* linearity of splittable source */ + extern VIEW ourview; /* our view */ extern VIEW pictview; /* picture view */ extern VIEW leftview, rightview; /* leftmost and rightmost views */ @@ -40,9 +46,9 @@ extern int hsize; /* horizontal size */ #define nglardirs (2*nglarangs+1) #define vsize (sampdens-1) -#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))) +#define hscale(v) sqrt((double)(sampdens*sampdens - (v)*(v))) +#define hlim(v) (int)(maxtheta*hscale(v)) +#define h_theta(h,v) (-(h)/hscale(v)) extern struct illum { float theta; /* glare direction */ @@ -67,8 +73,16 @@ extern struct source { struct source *next; /* next source in list */ } *donelist; /* finished sources */ -extern double getviewpix(); -extern double pixsize(); +extern double getviewpix(int vh, int vv); +extern double pixsize(int x, int y); extern long npixinvw; /* number of samples in view */ extern long npixmiss; /* number of samples missing */ + + + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_GLARE_H_ */ +