| 11 |
|
#include "color.h" |
| 12 |
|
#include "setscan.h" |
| 13 |
|
|
| 14 |
< |
#define GLAREBR 10.0 /* glare source is this * avg. lum. */ |
| 14 |
> |
#define GLAREBR 7.0 /* glare source is this * avg. lum. */ |
| 15 |
|
|
| 16 |
|
#define SAMPDENS 50 /* default samples per unit in image */ |
| 17 |
|
#define TSAMPSTEP 10 /* sample step to compute threshold */ |
| 18 |
|
|
| 19 |
< |
#define SEPS 2 /* sources this close ==> contig. */ |
| 19 |
> |
#define SEPS 1 /* sources this close ==> contig. */ |
| 20 |
|
|
| 21 |
|
#define SAMIN .005 /* minimum solid angle for source */ |
| 22 |
|
#define MAXBUDDY (4.*sqrt(SAMIN/PI)) /* max separation for pairing */ |
| 37 |
|
extern int nglarangs; |
| 38 |
|
extern double maxtheta; /* maximum glare angle (in radians) */ |
| 39 |
|
extern int hsize; /* horizontal size */ |
| 40 |
– |
extern int hlim; /* horizontal limit of central view */ |
| 40 |
|
|
| 41 |
|
#define nglardirs (2*nglarangs+1) |
| 42 |
|
#define vsize (sampdens-1) |
| 43 |
< |
#define h_theta(h) (-(double)(h)/(double)sampdens) |
| 43 |
> |
#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 |
|
|
| 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 |
< |
int n; /* number of values in sum */ |
| 52 |
> |
double n; /* number of values in sum */ |
| 53 |
|
} *indirect; /* array of indirect illuminances */ |
| 54 |
|
|
| 55 |
|
struct srcspan { |
| 68 |
|
} *donelist; /* finished sources */ |
| 69 |
|
|
| 70 |
|
extern double getviewpix(); |
| 71 |
+ |
extern double pixsize(); |
| 72 |
+ |
|
| 73 |
+ |
extern long npixinvw; /* number of samples in view */ |
| 74 |
+ |
extern long npixmiss; /* number of samples missing */ |