ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pcond.h
Revision: 3.10
Committed: Sat Feb 22 02:07:27 2003 UTC (21 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: rad3R5
Changes since 3.9: +11 -8 lines
Log Message:
Changes and check-in for 3.5 release
Includes new source files and modifications not recorded for many years
See ray/doc/notes/ReleaseNotes for notes between 3.1 and 3.5 release

File Contents

# Content
1 /* RCSid: $Id$ */
2 /*
3 * Header file for picture file conditioning.
4 */
5
6 #include "standard.h"
7
8 #include "color.h"
9
10 #include "view.h"
11
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)
19
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.0) /* foveal diameter (radians) */
24
25 #define HISTRES 100 /* histogram resolution */
26 #define MAXPREHIST 1024 /* maximum precomputed histogram */
27
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 */
32 #define Bl1(Lw) (1.0/(Lw)) /* first derivative of Bl(Lw) */
33 #define Lb(Bw) exp(Bw) /* inverse of brightness function */
34 #define Lb1(Bw) exp(Bw) /* first derivative of Lb(Bw) */
35
36 /* Flags of what to do */
37 #define DO_ACUITY 01
38 #define DO_VEIL 02
39 #define DO_HSENS 04
40 #define DO_COLOR 010
41 #define DO_CWEIGHT 020
42 #define DO_FIXHIST 040
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 lddyn; /* display dynamic range */
52 extern double Bldmin, Bldmax; /* Bl(ldmax/lddyn) and Bl(ldmax) */
53
54 extern char *progname; /* global argv[0] */
55
56 extern char *infn; /* input file name */
57 extern FILE *infp; /* input stream */
58 extern double rgblum(), cielum(); /* luminance functions */
59 extern double (*lumf)(); /* input luminance function */
60 extern double inpexp; /* input exposure value */
61
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 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 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 */
82
83 #define bwhi(B) (int)(HISTRES*((B)-bwmin)/(bwmax-bwmin))
84
85 extern RGBPRIMP inprims; /* input primaries */
86 extern COLORMAT inrgb2xyz; /* convert input RGB to XYZ */
87
88 extern RGBPRIMP outprims; /* output primaries */
89
90 extern double scalef; /* linear scaling factor */
91
92 extern VIEW ourview; /* picture view */
93 extern double pixaspect; /* pixel aspect ratio */
94 extern RESOLU inpres; /* input picture resolution */
95
96 extern char *mbcalfile; /* macbethcal mapping file */
97 extern char *cwarpfile; /* color warp mapping file */
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 */