1 |
< |
/* Copyright (c) 1997 Regents of the University of California */ |
2 |
< |
|
3 |
< |
/* SCCSid "$SunId$ LBL" */ |
4 |
< |
|
1 |
> |
/* RCSid: $Id$ */ |
2 |
|
/* |
3 |
|
* Header file for picture file conditioning. |
4 |
|
*/ |
9 |
|
|
10 |
|
#include "view.h" |
11 |
|
|
15 |
– |
#include "resolu.h" |
12 |
|
|
13 |
+ |
#ifndef ADJ_VEIL |
14 |
+ |
#define ADJ_VEIL 0 /* adjust veil to preserve contrast? */ |
15 |
+ |
#endif |
16 |
|
|
17 |
|
#define SWNORM 2.26 /* scotopic/photopic ratio for white */ |
18 |
|
#define WHTSEFFICACY (SWNORM*WHTEFFICACY) |
20 |
|
#define BotMesopic 5.62e-3 /* top of scotopic range */ |
21 |
|
#define TopMesopic 5.62 /* bottom of photopic range */ |
22 |
|
|
23 |
< |
#define FOVDIA (1.0*PI/180.) /* foveal diameter (radians) */ |
23 |
> |
#define FOVDIA (1.0*PI/180.0) /* foveal diameter (radians) */ |
24 |
|
|
25 |
|
#define HISTRES 100 /* histogram resolution */ |
26 |
+ |
#define MAXPREHIST 1024 /* maximum precomputed histogram */ |
27 |
|
|
28 |
< |
#define LMIN 1e-4 /* minimum visible world luminance */ |
28 |
> |
#define LMIN 1e-7 /* minimum visible world luminance */ |
29 |
|
#define LMAX 1e5 /* maximum visible world luminance */ |
30 |
|
|
31 |
|
#define Bl(Lw) log(Lw) /* brightness function */ |
40 |
|
#define DO_COLOR 010 |
41 |
|
#define DO_CWEIGHT 020 |
42 |
|
#define DO_FIXHIST 040 |
43 |
< |
#define DO_LINEAR 0100 |
43 |
> |
#define DO_PREHIST 0100 |
44 |
> |
#define DO_LINEAR 0200 |
45 |
|
|
46 |
|
#define DO_HUMAN (DO_ACUITY|DO_VEIL|DO_HSENS|DO_COLOR) |
47 |
|
|
48 |
|
extern int what2do; /* desired adjustments */ |
49 |
|
|
50 |
|
extern double ldmax; /* maximum output luminance */ |
51 |
< |
extern double ldmin; /* minimum output luminance */ |
52 |
< |
extern double Bldmin, Bldmax; /* Bl(ldmin) and Bl(ldmax) */ |
51 |
> |
extern double lddyn; /* display dynamic range */ |
52 |
> |
extern double Bldmin, Bldmax; /* Bl(ldmax/lddyn) and Bl(ldmax) */ |
53 |
|
|
54 |
|
extern char *progname; /* global argv[0] */ |
55 |
|
|
62 |
|
#define plum(clr) ((*lumf)(clr,0)/inpexp) |
63 |
|
#define slum(clr) ((*lumf)(clr,1)/inpexp) |
64 |
|
|
65 |
+ |
#define ldmin (ldmax/lddyn) |
66 |
+ |
|
67 |
|
extern COLOR *fovimg; /* foveal (1 degree) averaged image */ |
68 |
< |
extern short fvxr, fvyr; /* foveal image resolution */ |
68 |
> |
extern int fvxr, fvyr; /* foveal image resolution */ |
69 |
> |
extern float *crfimg; /* contrast reduction factors */ |
70 |
|
|
71 |
|
#define fovscan(y) (fovimg+(y)*fvxr) |
72 |
+ |
#define crfscan(y) (crfimg+(y)*fvxr) |
73 |
|
|
74 |
|
extern double fixfrac; /* histogram share due to fixations */ |
75 |
|
extern short (*fixlst)[2]; /* fixation history list */ |
76 |
|
extern int nfixations; /* number of fixation points */ |
77 |
|
|
78 |
< |
extern float bwhist[HISTRES]; /* luminance histogram */ |
78 |
> |
extern double bwhist[HISTRES]; /* luminance histogram */ |
79 |
|
extern double histot; /* total count of histogram */ |
80 |
|
extern double bwmin, bwmax; /* histogram limits */ |
81 |
|
extern double bwavg; /* mean brightness */ |
98 |
|
|
99 |
|
extern double hacuity(); /* human acuity func. (cycles/deg.) */ |
100 |
|
extern double htcontrs(); /* human contrast sens. func. */ |
101 |
+ |
extern double clampf(); /* histogram clamping function */ |
102 |
+ |
extern double crfactor(); /* contrast reduction factor */ |
103 |
|
|
104 |
|
extern COLOR *firstscan(); /* first processed scanline */ |
105 |
|
extern COLOR *nextscan(); /* next processed scanline */ |