ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pcond.h
Revision: 3.8
Committed: Mon Feb 9 13:22:26 1998 UTC (26 years, 2 months ago) by gwlarson
Content type: text/plain
Branch: MAIN
Changes since 3.7: +3 -3 lines
Log Message:
decreased lower threshold for histogram

File Contents

# User Rev Content
1 gwlarson 3.8 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2 greg 3.1
3 gwlarson 3.8 /* SCCSid "$SunId$ SGI" */
4 greg 3.1
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 greg 3.3 #define BotMesopic 5.62e-3 /* top of scotopic range */
22     #define TopMesopic 5.62 /* bottom of photopic range */
23    
24 greg 3.1 #define FOVDIA (1.0*PI/180.) /* foveal diameter (radians) */
25    
26     #define HISTRES 100 /* histogram resolution */
27    
28 gwlarson 3.8 #define LMIN 1e-7 /* minimum visible world luminance */
29 greg 3.1 #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 greg 3.2 #define DO_ACUITY 01
38 greg 3.1 #define DO_VEIL 02
39     #define DO_HSENS 04
40     #define DO_COLOR 010
41     #define DO_CWEIGHT 020
42 greg 3.5 #define DO_FIXHIST 040
43     #define DO_LINEAR 0100
44 greg 3.1
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 greg 3.7 extern double lddyn; /* display dynamic range */
51     extern double Bldmin, Bldmax; /* Bl(ldmax/lddyn) and Bl(ldmax) */
52 greg 3.1
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 greg 3.7
64     #define ldmin (ldmax/lddyn)
65 greg 3.1
66     extern COLOR *fovimg; /* foveal (1 degree) averaged image */
67     extern short fvxr, fvyr; /* foveal image resolution */
68    
69     #define fovscan(y) (fovimg+(y)*fvxr)
70 greg 3.5
71     extern double fixfrac; /* histogram share due to fixations */
72     extern short (*fixlst)[2]; /* fixation history list */
73     extern int nfixations; /* number of fixation points */
74 greg 3.1
75 greg 3.4 extern float bwhist[HISTRES]; /* luminance histogram */
76     extern double histot; /* total count of histogram */
77 greg 3.1 extern double bwmin, bwmax; /* histogram limits */
78     extern double bwavg; /* mean brightness */
79    
80 greg 3.4 #define bwhi(B) (int)(HISTRES*((B)-bwmin)/(bwmax-bwmin))
81 greg 3.1
82     extern RGBPRIMP inprims; /* input primaries */
83     extern COLORMAT inrgb2xyz; /* convert input RGB to XYZ */
84    
85     extern RGBPRIMP outprims; /* output primaries */
86    
87     extern double scalef; /* linear scaling factor */
88    
89     extern VIEW ourview; /* picture view */
90     extern double pixaspect; /* pixel aspect ratio */
91     extern RESOLU inpres; /* input picture resolution */
92    
93     extern char *mbcalfile; /* macbethcal mapping file */
94 greg 3.6 extern char *cwarpfile; /* color warp mapping file */
95 greg 3.1
96     extern double hacuity(); /* human acuity func. (cycles/deg.) */
97     extern double htcontrs(); /* human contrast sens. func. */
98    
99     extern COLOR *firstscan(); /* first processed scanline */
100     extern COLOR *nextscan(); /* next processed scanline */