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

Comparing ray/src/px/pfilt.c (file contents):
Revision 1.14 by greg, Sat Dec 8 13:23:47 1990 UTC vs.
Revision 1.15 by greg, Fri Dec 14 16:33:16 1990 UTC

# Line 19 | Line 19 | static char SCCSid[] = "$SunId$ LBL";
19   extern char  *malloc();
20   extern float  *matchlamp();
21  
22 + #define  FEQ(a,b)       ((a) >= .98*(b) && (a) <= 1.02*(b))
23 +
24   #define  CHECKRAD       1.5     /* radius to check for filtering */
25  
26   COLOR  exposure = WHTCOLOR;     /* exposure for the frame */
# Line 121 | Line 123 | char  **argv;
123                                          d = pow(2.0, atof(argv[i+1]));
124                                  else
125                                          d = atof(argv[i+1]);
126 +                                if (d < 1e-20 || d > 1e20) {
127 +                                        fprintf(stderr,
128 +                                                "%s: exposure out of range\n",
129 +                                                        argv[0]);
130 +                                        exit(1);
131 +                                }
132                                  switch (argv[i][2]) {
133                                  case '\0':
134                                          scalecolor(exposure, d);
# Line 366 | Line 374 | FILE  *in;
374  
375   scan2init()                     /* prepare scanline arrays */
376   {
377 +        COLOR   ctmp;
378          double  d;
379          register int  i;
380  
# Line 395 | Line 404 | scan2init()                    /* prepare scanline arrays */
404                  fprintf(stderr, "%s: out of memory\n", progname);
405                  quit(1);
406          }
407 <                                        /* record pixel aspect and exposure */
407 >                                        /* record pixel aspect ratio */
408          if (!correctaspect) {
409                  d = x_c / y_r;
410 <                if (d < .99 || d > 1.01)
410 >                if (!FEQ(d,1.0))
411                          fputaspect(d, stdout);
412          }
413 +                                        /* record exposure */
414          d = bright(exposure);
415 <        if (d < .995 || d > 1.005)
415 >        if (!FEQ(d,1.0))
416                  fputexpos(d, stdout);
417 +                                        /* record color correction */
418 +        copycolor(ctmp, exposure);
419 +        scalecolor(ctmp, 1.0/d);
420 +        if (!FEQ(colval(ctmp,RED),colval(ctmp,GRN)) ||
421 +                        !FEQ(colval(ctmp,GRN),colval(ctmp,BLU)))
422 +                fputcolcor(ctmp, stdout);
423          printf("\n");
424 <        fputresolu(YMAJOR|YDECR, ncols, nrows, stdout); /* resolution */
424 >                                        /* write out resolution */
425 >        fputresolu(YMAJOR|YDECR, ncols, nrows, stdout);
426   }
427  
428  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines