ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/pcond.h
(Generate patch)

Comparing ray/src/px/pcond.h (file contents):
Revision 3.2 by greg, Fri Oct 4 18:34:56 1996 UTC vs.
Revision 3.16 by greg, Sat Jun 7 05:09:46 2025 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1996 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid: $Id$ */
2   /*
3   * Header file for picture file conditioning.
4   */
5 + #ifndef _RAD_PCOND_H_
6 + #define _RAD_PCOND_H_
7  
8   #include "standard.h"
10
9   #include "color.h"
12
10   #include "view.h"
11 + #include "paths.h"
12  
13 < #include "resolu.h"
13 > #ifdef __cplusplus
14 > extern "C" {
15 > #endif
16  
17 + #ifndef ADJ_VEIL
18 + #define ADJ_VEIL        0               /* adjust veil to preserve contrast? */
19 + #endif
20  
21   #define SWNORM          2.26            /* scotopic/photopic ratio for white */
22   #define WHTSEFFICACY    (SWNORM*WHTEFFICACY)
23  
24 < #define FOVDIA          (1.0*PI/180.)   /* foveal diameter (radians) */
24 > #define BotMesopic      5.62e-3         /* top of scotopic range */
25 > #define TopMesopic      5.62            /* bottom of photopic range */
26  
27 + #define FOVDIA          (1.0*PI/180.0)  /* foveal diameter (radians) */
28 +
29   #define HISTRES         100             /* histogram resolution */
30 + #define MAXPREHIST      1024            /* maximum precomputed histogram */
31  
32 < #define LMIN            1e-4            /* minimum visible world luminance */
33 < #define LMAX            1e5             /* maximum visible world luminance */
32 > #define LMIN            1e-7            /* minimum visible world luminance */
33 > #define LMAX            1e7             /* maximum visible world luminance */
34  
35   #define Bl(Lw)          log(Lw)         /* brightness function */
36   #define Bl1(Lw)         (1.0/(Lw))      /* first derivative of Bl(Lw) */
# Line 36 | Line 43
43   #define DO_HSENS        04
44   #define DO_COLOR        010
45   #define DO_CWEIGHT      020
46 < #define DO_LINEAR       040
46 > #define DO_FIXHIST      040
47 > #define DO_PREHIST      0100
48 > #define DO_LINEAR       0200
49  
50   #define DO_HUMAN        (DO_ACUITY|DO_VEIL|DO_HSENS|DO_COLOR)
51  
52   extern int      what2do;                /* desired adjustments */
53  
54   extern double   ldmax;                  /* maximum output luminance */
55 < extern double   ldmin;                  /* minimum output luminance */
56 < extern double   Bldmin, Bldmax;         /* Bl(ldmin) and Bl(ldmax) */
55 > extern double   lddyn;                  /* display dynamic range */
56 > extern double   Bldmin, Bldmax;         /* Bl(ldmax/lddyn) and Bl(ldmax) */
57  
58   extern char     *progname;              /* global argv[0] */
59  
60   extern char     *infn;                  /* input file name */
61   extern FILE     *infp;                  /* input stream */
53 extern double   rgblum(), cielum();     /* luminance functions */
62   extern double   (*lumf)();              /* input luminance function */
63   extern double   inpexp;                 /* input exposure value */
64  
65   #define plum(clr)       ((*lumf)(clr,0)/inpexp)
66   #define slum(clr)       ((*lumf)(clr,1)/inpexp)
67  
68 + #define ldmin           (ldmax/lddyn)
69 +
70   extern COLOR    *fovimg;                /* foveal (1 degree) averaged image */
71 < extern short    fvxr, fvyr;             /* foveal image resolution */
71 > extern int      fvxr, fvyr;             /* foveal image resolution */
72 > extern float    *crfimg;                /* contrast reduction factors */
73  
74   #define fovscan(y)      (fovimg+(y)*fvxr)
75 + #define crfscan(y)      (crfimg+(y)*fvxr)
76  
77 < extern int      bwhist[HISTRES];        /* luminance histogram */
78 < extern long     histot;                 /* total count of histogram */
77 > extern double   fixfrac;                /* histogram share due to fixations */
78 > extern short    (*fixlst)[2];           /* fixation history list */
79 > extern int      nfixations;             /* number of fixation points */
80 >
81 > extern double   bwhist[HISTRES];        /* luminance histogram */
82 > extern double   histot;                 /* total count of histogram */
83   extern double   bwmin, bwmax;           /* histogram limits */
84   extern double   bwavg;                  /* mean brightness */
85  
86 < #define bwhc(B)         bwhist[(int)(HISTRES*((B)-bwmin)/(bwmax-bwmin))]
86 > #define bwhi(B)         (int)(HISTRES*((B)-bwmin)/(bwmax-bwmin))
87  
88   extern RGBPRIMP inprims;                /* input primaries */
89   extern COLORMAT inrgb2xyz;              /* convert input RGB to XYZ */
# Line 81 | Line 97 | extern double  pixaspect;              /* pixel aspect ratio */
97   extern RESOLU   inpres;                 /* input picture resolution */
98  
99   extern char     *mbcalfile;             /* macbethcal mapping file */
100 + extern char     *cwarpfile;             /* color warp mapping file */
101  
85 extern double   hacuity();              /* human acuity func. (cycles/deg.) */
86 extern double   htcontrs();             /* human contrast sens. func. */
102  
103 < extern COLOR    *firstscan();           /* first processed scanline */
104 < extern COLOR    *nextscan();            /* next processed scanline */
103 >
104 >        /* defined in pcond.c */
105 > extern void syserror(char *s);
106 >
107 >        /* defined in pcond2.c */
108 > extern double rgblum(COLOR clr, int scotopic);  /* compute (scotopic) luminance of RGB color */
109 > extern double cielum(COLOR xyz, int scotopic);  /* compute (scotopic) luminance of CIE color */
110 > extern COLOR    *nextscan(void);                /* next processed scanline */
111 > extern COLOR    *firstscan(void);               /* first processed scanline */
112 >
113 >        /* defined in pcond3.c */
114 > extern void getfixations(FILE *fp);     /* load fixation history list */
115 > extern void gethisto(FILE *fp);         /* load precomputed luminance histogram */
116 > extern void comphist(void);             /* create foveal sampling histogram */
117 > extern double htcontrs(double La);      /* human contrast sens. func. */
118 > extern double clampf(double La);        /* histogram clamping function */
119 > extern double crfactor(double La);      /* contrast reduction factor */
120 > extern int mkbrmap(void);               /* make dynamic range map */
121 > extern void putmapping(FILE     *fp);   /* put out mapping function */
122 > extern void scotscan(COLOR *scan, int xres);    /* apply scotopic color sensitivity loss */
123 > extern void mapscan(COLOR *scan, int xres);     /* apply tone mapping operator to scanline */
124 >
125 >        /* defined in pcond4.c */
126 > extern void compveil(void);             /* compute veiling image */
127 > #if ADJ_VEIL
128 > extern void adjveil(void);              /* adjust veil image */
129 > #endif
130 > extern void acuscan(COLOR *scln, int y);        /* get acuity-sampled scanline */
131 > extern void addveil(COLOR *sl, int y);  /* add veil to scanline */
132 > extern void initacuity(void);           /* initialize variable acuity sampling */
133 > extern double hacuity(double La);       /* human acuity func. (cycles/deg.) */
134 >
135 > #ifdef __cplusplus
136 > }
137 > #endif
138 > #endif /* _RAD_PCOND_H_ */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines