ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pcond.h
Revision: 3.6
Committed: Wed Feb 5 16:08:16 1997 UTC (27 years, 2 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 3.5: +1 -0 lines
Log Message:
changed -m option to read in color warp map (old -m now -d)

File Contents

# Content
1 /* Copyright (c) 1997 Regents of the University of California */
2
3 /* SCCSid "$SunId$ LBL" */
4
5 /*
6 * Header file for picture file conditioning.
7 */
8
9 #include "standard.h"
10
11 #include "color.h"
12
13 #include "view.h"
14
15 #include "resolu.h"
16
17
18 #define SWNORM 2.26 /* scotopic/photopic ratio for white */
19 #define WHTSEFFICACY (SWNORM*WHTEFFICACY)
20
21 #define BotMesopic 5.62e-3 /* top of scotopic range */
22 #define TopMesopic 5.62 /* bottom of photopic range */
23
24 #define FOVDIA (1.0*PI/180.) /* foveal diameter (radians) */
25
26 #define HISTRES 100 /* histogram resolution */
27
28 #define LMIN 1e-4 /* 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_LINEAR 0100
44
45 #define DO_HUMAN (DO_ACUITY|DO_VEIL|DO_HSENS|DO_COLOR)
46
47 extern int what2do; /* desired adjustments */
48
49 extern double ldmax; /* maximum output luminance */
50 extern double ldmin; /* minimum output luminance */
51 extern double Bldmin, Bldmax; /* Bl(ldmin) and Bl(ldmax) */
52
53 extern char *progname; /* global argv[0] */
54
55 extern char *infn; /* input file name */
56 extern FILE *infp; /* input stream */
57 extern double rgblum(), cielum(); /* luminance functions */
58 extern double (*lumf)(); /* input luminance function */
59 extern double inpexp; /* input exposure value */
60
61 #define plum(clr) ((*lumf)(clr,0)/inpexp)
62 #define slum(clr) ((*lumf)(clr,1)/inpexp)
63
64 extern COLOR *fovimg; /* foveal (1 degree) averaged image */
65 extern short fvxr, fvyr; /* foveal image resolution */
66
67 #define fovscan(y) (fovimg+(y)*fvxr)
68
69 extern double fixfrac; /* histogram share due to fixations */
70 extern short (*fixlst)[2]; /* fixation history list */
71 extern int nfixations; /* number of fixation points */
72
73 extern float bwhist[HISTRES]; /* luminance histogram */
74 extern double histot; /* total count of histogram */
75 extern double bwmin, bwmax; /* histogram limits */
76 extern double bwavg; /* mean brightness */
77
78 #define bwhi(B) (int)(HISTRES*((B)-bwmin)/(bwmax-bwmin))
79
80 extern RGBPRIMP inprims; /* input primaries */
81 extern COLORMAT inrgb2xyz; /* convert input RGB to XYZ */
82
83 extern RGBPRIMP outprims; /* output primaries */
84
85 extern double scalef; /* linear scaling factor */
86
87 extern VIEW ourview; /* picture view */
88 extern double pixaspect; /* pixel aspect ratio */
89 extern RESOLU inpres; /* input picture resolution */
90
91 extern char *mbcalfile; /* macbethcal mapping file */
92 extern char *cwarpfile; /* color warp mapping file */
93
94 extern double hacuity(); /* human acuity func. (cycles/deg.) */
95 extern double htcontrs(); /* human contrast sens. func. */
96
97 extern COLOR *firstscan(); /* first processed scanline */
98 extern COLOR *nextscan(); /* next processed scanline */