14 |
|
|
15 |
|
#define VADAPT 0.08 /* fraction of adaptation from veil */ |
16 |
|
|
17 |
< |
extern COLOR *fovimg; /* foveal (1 degree) averaged image */ |
18 |
< |
extern short fvxr, fvyr; /* foveal image resolution */ |
17 |
> |
static COLOR *veilimg = NULL; /* veiling image */ |
18 |
|
|
20 |
– |
#define fovscan(y) (fovimg+(y)*fvxr) |
21 |
– |
|
22 |
– |
static COLOR *veilimg; /* veiling image */ |
23 |
– |
|
19 |
|
#define veilscan(y) (veilimg+(y)*fvxr) |
20 |
|
|
21 |
|
static float (*raydir)[3] = NULL; /* ray direction for each pixel */ |
78 |
|
COLOR ctmp, vsum; |
79 |
|
int px, py; |
80 |
|
register int x, y; |
81 |
+ |
|
82 |
+ |
if (veilimg != NULL) /* already done? */ |
83 |
+ |
return; |
84 |
|
/* compute ray directions */ |
85 |
|
compraydir(); |
86 |
|
/* compute veil image */ |
111 |
|
scalecolor(vsum, VADAPT/t2sum); |
112 |
|
copycolor(veilscan(py)[px], vsum); |
113 |
|
} |
114 |
+ |
/* modify FOV sample image */ |
115 |
+ |
for (y = 0; y < fvyr; y++) |
116 |
+ |
for (x = 0; x < fvxr; x++) { |
117 |
+ |
scalecolor(fovscan(y)[x], 1.-VADAPT); |
118 |
+ |
addcolor(fovscan(y)[x], veilscan(y)[x]); |
119 |
+ |
} |
120 |
+ |
comphist(); /* recompute histogram */ |
121 |
|
} |
122 |
|
|
123 |
|
|