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.14 by greg, Sat Feb 22 02:07:27 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 "pcond.h"
# Line 32 | Line 30 | double fixfrac = 0.;                   /* histogram share due to fixat
30   RESOLU  inpres;                         /* input picture resolution */
31  
32   COLOR   *fovimg;                        /* foveal (1 degree) averaged image */
33 < short   fvxr, fvyr;                     /* foveal image resolution */
33 > int     fvxr, fvyr;                     /* foveal image resolution */
34 > float   *crfimg;                        /* contrast reduction factors */
35   short   (*fixlst)[2];                   /* fixation history list */
36   int     nfixations;                     /* number of fixation points */
37 < float   bwhist[HISTRES];                /* luminance histogram */
37 > double  bwhist[HISTRES];                /* luminance histogram */
38   double  histot;                         /* total count of histogram */
39   double  bwmin, bwmax;                   /* histogram limits */
40   double  bwavg;                          /* mean brightness */
# Line 238 | Line 237 | getahead()                     /* load picture header */
237                  exit(1);
238          }
239          if (lumf == rgblum)
240 <                comprgb2xyzmat(inrgb2xyz, inprims);
240 >                comprgb2xyzWBmat(inrgb2xyz, inprims);
241          else if (mbcalfile != NULL) {
242                  fprintf(stderr, "%s: macbethcal only works with RGB pictures\n",
243                                  progname);
# Line 272 | Line 271 | mapimage()                             /* map picture and send to stdout */
271          comphist();                     /* generate adaptation histogram */
272          check2do();                     /* modify what2do flags */
273          if (what2do&DO_VEIL)
274 <                compveil();
275 <        if (!(what2do&DO_LINEAR) && mkbrmap() < 0)      /* make tone map */
276 <                what2do |= DO_LINEAR;   /* failed! -- use linear scaling */
274 >                compveil();             /* compute veil image */
275 >        if (!(what2do&DO_LINEAR))
276 >                if (mkbrmap() < 0)      /* make tone map */
277 >                        what2do |= DO_LINEAR;   /* failed! -- use linear */
278 > #if ADJ_VEIL
279 >                else if (what2do&DO_VEIL)
280 >                        adjveil();      /* else adjust veil image */
281 > #endif
282          if (what2do&DO_LINEAR) {
283                  if (scalef <= FTINY) {
284                          if (what2do&DO_HSENS)
# Line 311 | Line 315 | getfovimg()                    /* load foveal sampled image */
315          if (fvxr < 2) fvxr = 2;
316          fvyr = sqrt(ourview.vn2)/FOVDIA + 0.5;
317          if (fvyr < 2) fvyr = 2;
318 <        if (!(inpres.or & YMAJOR)) {            /* picture is rotated? */
318 >        if (!(inpres.rt & YMAJOR)) {            /* picture is rotated? */
319                  y = fvyr;
320                  fvyr = fvxr;
321                  fvxr = y;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines