1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ LBL" */ |
4 |
< |
|
1 |
> |
/* RCSid: $Id$ */ |
2 |
|
/* |
3 |
|
* Common data structures for glare source finding routines |
4 |
|
*/ |
5 |
+ |
#ifndef _RAD_GLARE_H_ |
6 |
+ |
#define _RAD_GLARE_H_ |
7 |
|
|
8 |
|
#include "standard.h" |
9 |
|
#include "view.h" |
10 |
|
#include "color.h" |
11 |
|
#include "setscan.h" |
12 |
|
|
13 |
< |
#define GLAREBR 10.0 /* glare source is this * avg. lum. */ |
13 |
> |
#ifdef __cplusplus |
14 |
> |
extern "C" { |
15 |
> |
#endif |
16 |
|
|
17 |
< |
#define SAMPDENS 50 /* default samples per unit in image */ |
17 |
> |
#define GLAREBR 7.0 /* glare source is this * avg. lum. */ |
18 |
> |
|
19 |
> |
#define SAMPDENS 75 /* default samples per unit in image */ |
20 |
|
#define TSAMPSTEP 10 /* sample step to compute threshold */ |
21 |
|
|
22 |
< |
#define SEPS 2 /* sources this close ==> contig. */ |
22 |
> |
#define SEPS 1 /* sources this close ==> contig. */ |
23 |
|
|
24 |
+ |
#define SAMIN .005 /* minimum solid angle for source */ |
25 |
+ |
#define MAXBUDDY (4.*sqrt(SAMIN/PI)) /* max separation for pairing */ |
26 |
+ |
|
27 |
+ |
#define TOOSMALL(s) ((s)->brt*(s)->dom < threshold*SAMIN) |
28 |
+ |
|
29 |
+ |
#define SABIG .025 /* solid angle of splittable source */ |
30 |
+ |
#define LCORR .12 /* linearity of splittable source */ |
31 |
+ |
|
32 |
|
extern VIEW ourview; /* our view */ |
33 |
|
extern VIEW pictview; /* picture view */ |
34 |
|
extern VIEW leftview, rightview; /* leftmost and rightmost views */ |
36 |
|
extern int verbose; /* verbose reporting */ |
37 |
|
extern char *progname; /* global argv[0] */ |
38 |
|
|
39 |
+ |
extern double threshold; /* threshold value for glare sources */ |
40 |
+ |
|
41 |
|
extern int sampdens; /* sample density */ |
42 |
|
extern ANGLE glarang[]; /* glare calculation angles */ |
43 |
|
extern int nglarangs; |
44 |
|
extern double maxtheta; /* maximum glare angle (in radians) */ |
45 |
|
extern int hsize; /* horizontal size */ |
33 |
– |
extern int hlim; /* horizontal limit of central view */ |
46 |
|
|
47 |
|
#define nglardirs (2*nglarangs+1) |
48 |
|
#define vsize (sampdens-1) |
49 |
< |
#define h_theta(h) (-(double)(h)/(double)sampdens) |
49 |
> |
#define hscale(v) sqrt((double)(sampdens*sampdens - (v)*(v))) |
50 |
> |
#define hlim(v) (int)(maxtheta*hscale(v)) |
51 |
> |
#define h_theta(h,v) (-(h)/hscale(v)) |
52 |
|
|
53 |
|
extern struct illum { |
54 |
|
float theta; /* glare direction */ |
55 |
|
float lcos, lsin; /* cosine and sine to left view */ |
56 |
|
float rcos, rsin; /* cosine and sine to right view */ |
57 |
|
double sum; /* sum of indirect luminances */ |
58 |
< |
int n; /* number of values in sum */ |
58 |
> |
double n; /* number of values in sum */ |
59 |
|
} *indirect; /* array of indirect illuminances */ |
60 |
|
|
61 |
|
struct srcspan { |
73 |
|
struct source *next; /* next source in list */ |
74 |
|
} *donelist; /* finished sources */ |
75 |
|
|
76 |
< |
extern double getviewpix(); |
76 |
> |
|
77 |
> |
extern long npixinvw; /* number of samples in view */ |
78 |
> |
extern long npixmiss; /* number of samples missing */ |
79 |
> |
|
80 |
> |
/* defined in findglare.c */; |
81 |
> |
extern void memerr(char *s); |
82 |
> |
extern int compdir(FVECT vd, int x, int y); |
83 |
> |
extern double pixsize(int x, int y); |
84 |
> |
/* defined in glaresrc.c */ |
85 |
> |
extern void comp_thresh(void); |
86 |
> |
extern void analyze(void); |
87 |
> |
extern void absorb_specks(void); |
88 |
> |
/* defined in glareval.c */ |
89 |
> |
extern void open_pict(char *fn); |
90 |
> |
extern void fork_rtrace(char *av[]); |
91 |
> |
extern void close_pict(void); |
92 |
> |
extern void done_rtrace(void); |
93 |
> |
extern void getviewspan(int vv, float *vb); |
94 |
> |
extern double getviewpix(int vh, int vv); |
95 |
> |
|
96 |
> |
#ifdef __cplusplus |
97 |
> |
} |
98 |
> |
#endif |
99 |
> |
#endif /* _RAD_GLARE_H_ */ |
100 |
> |
|