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

Comparing ray/src/px/pcond.c (file contents):
Revision 3.13 by gwlarson, Tue Oct 27 09:08:26 1998 UTC vs.
Revision 3.15 by schorsch, Thu Jun 5 19:29:34 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1997 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Condition Radiance picture for display/output
6 + *  Added white-balance adjustment 10/01 (GW).
7   */
8  
9 + #include "platform.h"
10   #include "pcond.h"
11  
12  
# Line 32 | Line 31 | double fixfrac = 0.;                   /* histogram share due to fixat
31   RESOLU  inpres;                         /* input picture resolution */
32  
33   COLOR   *fovimg;                        /* foveal (1 degree) averaged image */
34 < short   fvxr, fvyr;                     /* foveal image resolution */
34 > int     fvxr, fvyr;                     /* foveal image resolution */
35 > float   *crfimg;                        /* contrast reduction factors */
36   short   (*fixlst)[2];                   /* fixation history list */
37   int     nfixations;                     /* number of fixation points */
38 < float   bwhist[HISTRES];                /* luminance histogram */
38 > double  bwhist[HISTRES];                /* luminance histogram */
39   double  histot;                         /* total count of histogram */
40   double  bwmin, bwmax;                   /* histogram limits */
41   double  bwavg;                          /* mean brightness */
# Line 163 | Line 163 | char   *argv[];
163                                          /* open output file */
164          if (i+2 == argc && freopen(argv[i+1], "w", stdout) == NULL)
165                  syserror(argv[i+1]);
166 < #ifdef MSDOS
167 <        setmode(fileno(infp), O_BINARY);
168 <        setmode(fileno(stdout), O_BINARY);
169 < #endif
166 >        SET_FILE_BINARY(infp);
167 >        SET_FILE_BINARY(stdout);
168          getahead();                     /* load input header */
169          printargs(argc, argv, stdout);  /* add to output header */
170          if (mbcalfile == NULL & outprims != stdprims)
# Line 238 | Line 236 | getahead()                     /* load picture header */
236                  exit(1);
237          }
238          if (lumf == rgblum)
239 <                comprgb2xyzmat(inrgb2xyz, inprims);
239 >                comprgb2xyzWBmat(inrgb2xyz, inprims);
240          else if (mbcalfile != NULL) {
241                  fprintf(stderr, "%s: macbethcal only works with RGB pictures\n",
242                                  progname);
# Line 272 | Line 270 | mapimage()                             /* map picture and send to stdout */
270          comphist();                     /* generate adaptation histogram */
271          check2do();                     /* modify what2do flags */
272          if (what2do&DO_VEIL)
273 <                compveil();
274 <        if (!(what2do&DO_LINEAR) && mkbrmap() < 0)      /* make tone map */
275 <                what2do |= DO_LINEAR;   /* failed! -- use linear scaling */
273 >                compveil();             /* compute veil image */
274 >        if (!(what2do&DO_LINEAR))
275 >                if (mkbrmap() < 0)      /* make tone map */
276 >                        what2do |= DO_LINEAR;   /* failed! -- use linear */
277 > #if ADJ_VEIL
278 >                else if (what2do&DO_VEIL)
279 >                        adjveil();      /* else adjust veil image */
280 > #endif
281          if (what2do&DO_LINEAR) {
282                  if (scalef <= FTINY) {
283                          if (what2do&DO_HSENS)
# Line 311 | Line 314 | getfovimg()                    /* load foveal sampled image */
314          if (fvxr < 2) fvxr = 2;
315          fvyr = sqrt(ourview.vn2)/FOVDIA + 0.5;
316          if (fvyr < 2) fvyr = 2;
317 <        if (!(inpres.or & YMAJOR)) {            /* picture is rotated? */
317 >        if (!(inpres.rt & YMAJOR)) {            /* picture is rotated? */
318                  y = fvyr;
319                  fvyr = fvxr;
320                  fvxr = y;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines