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.3 by greg, Sat Oct 5 11:16:51 1996 UTC vs.
Revision 3.7 by greg, Wed Jan 8 21:40:38 1997 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1996 Regents of the University of California */
1 > /* Copyright (c) 1997 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 26 | Line 26 | char   *progname;                      /* global argv[0] */
26  
27   char    *infn;                          /* input file name */
28   FILE    *infp;                          /* input stream */
29 + FILE    *mapfp = NULL;                  /* tone-mapping function stream */
30   VIEW    ourview = STDVIEW;              /* picture view */
31   int     gotview = 0;                    /* picture has view */
32   double  pixaspect = 1.0;                /* pixel aspect ratio */
# Line 113 | Line 114 | char   *argv[];
114                          if (i+1 >= argc) goto userr;
115                          ldmin = atof(argv[++i]);
116                          break;
117 +                case 'm':
118 +                        if (i+1 >= argc) goto userr;
119 +                        if ((mapfp = fopen(argv[++i], "w")) == NULL) {
120 +                                fprintf(stderr,
121 +                                        "%s: cannot open for writing\n",
122 +                                                argv[i]);
123 +                                exit(1);
124 +                        }
125 +                        break;
126                  default:
127                          goto userr;
128                  }
# Line 147 | Line 157 | char   *argv[];
157          if (outprims != inprims)
158                  fputprims(outprims, stdout);
159          mapimage();                     /* map the picture */
160 +        if (mapfp != NULL)              /* write out basic mapping */
161 +                putmapping(mapfp);
162          exit(0);
163   userr:
164 <        fprintf(stderr, "Usage: %s [-{h|a|v|s|c|l|w}[+-]][-e ev][-p xr yr xg yg xb yb xw yw|-f mbf.cal][-t Ldmax][-b Ldmin] inpic [outpic]\n",
164 >        fprintf(stderr, "Usage: %s [-{h|a|v|s|c|l|w}[+-]][-e ev][-p xr yr xg yg xb yb xw yw|-f mbf.cal][-t Ldmax][-b Ldmin][-m mapfile] inpic [outpic]\n",
165                          progname);
166          exit(1);
167   #undef bool
# Line 278 | Line 290 | mapimage()                             /* map picture and send to stdout */
290                  fprintf(stderr, "%s: linear scaling factor = %f\n",
291                                  progname, scalef);
292   #endif
293 <                if (scalef < 0.99 | scalef > 1.01)
282 <                        fputexpos(scalef, stdout);      /* write in header */
293 >                fputexpos(inpexp*scalef, stdout);       /* record exposure */
294                  if (lumf == cielum) scalef /= WHTEFFICACY;
295          }
296          putchar('\n');                  /* complete header */
# Line 346 | Line 357 | fovhist()                      /* create foveal sampled image and histogr
357          if (lwmin < LMIN) lwmin = LMIN;
358          if (lwmax > LMAX) lwmax = LMAX;
359                                          /* compute histogram */
360 <        bwmin = Bl(lwmin)*(1. - .01/HISTRES);
361 <        bwmax = Bl(lwmax)*(1. + .01/HISTRES);
360 >        bwmin = Bl(lwmin);
361 >        bwmax = Bl(lwmax);
362          bwavg = 0.;
363          for (y = 0; y < fvyr; y++)
364                  for (x = 0; x < fvxr; x++) {
# Line 355 | Line 366 | fovhist()                      /* create foveal sampled image and histogr
366                                          frandom() > centprob(x,y))
367                                  continue;
368                          l = plum(fovscan(y)[x]);
369 +                        if (l < lwmin) continue;
370 +                        if (l > lwmax) continue;
371                          b = Bl(l);
359                        if (b < bwmin) continue;
360                        if (b > bwmax) continue;
372                          bwavg += b;
373                          bwhc(b)++;
374                          histot++;
# Line 397 | Line 408 | check2do()             /* check histogram to see what isn't worth
408                                          /* determine if acuity adj. useful */
409          if (what2do&DO_ACUITY &&
410                          hacuity(l) >= (inpres.xr/sqrt(ourview.hn2) +
411 <                        inpres.yr/sqrt(ourview.vn2))/(2.*180./PI*2.))
411 >                        inpres.yr/sqrt(ourview.vn2))/(2.*180./PI))
412                  what2do &= ~DO_ACUITY;
413                                          /* color sensitivity loss? */
414 <        if (l >= 6.0)
414 >        if (l >= TopMesopic)
415                  what2do &= ~DO_COLOR;
416   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines