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 2.14 by greg, Wed May 31 08:50:27 1995 UTC vs.
Revision 2.16 by greg, Wed Feb 14 20:19:52 1996 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1992 Regents of the University of California */
1 > /* Copyright (c) 1996 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 302 | Line 302 | char  **argv;
302   }
303  
304  
305 + double
306 + rgb_bright(clr)
307 + COLOR  clr;
308 + {
309 +        return(bright(clr));
310 + }
311 +
312 +
313 + double
314 + xyz_bright(clr)
315 + COLOR  clr;
316 + {
317 +        return(clr[CIEY]);
318 + }
319 +
320 +
321 + double  (*ourbright)() = rgb_bright;
322 +
323 +
324   headline(s)                             /* process line from header */
325   char  *s;
326   {
# Line 310 | Line 329 | char  *s;
329          fputs(s, stdout);               /* copy to output */
330          if (isaspect(s))                /* get aspect ratio */
331                  inpaspect *= aspectval(s);
332 <        else if (isexpos(s))
332 >        else if (isexpos(s))            /* get exposure */
333                  hotlvl *= exposval(s);
334 <        else if (isformat(s)) {
335 <                formatval(fmt, s);
336 <                wrongformat = strcmp(fmt, COLRFMT);
334 >        else if (formatval(fmt, s)) {   /* get format */
335 >                wrongformat = 0;
336 >                if (!strcmp(COLRFMT, fmt))
337 >                        ourbright = rgb_bright;
338 >                else if (!strcmp(CIEFMT, fmt))
339 >                        ourbright = xyz_bright;
340 >                else
341 >                        wrongformat = !globmatch(PICFMT, fmt);
342          }
343   }
344  
# Line 430 | Line 454 | scan2init()                    /* prepare scanline arrays */
454                          rad *= (y_r + x_c)/2.0;
455  
456                  if (thresh > FTINY) {
433                        xrad = CHECKRAD*THRESHRAD*rad/x_c + xbrad;
434                        yrad = CHECKRAD*THRESHRAD*rad/y_r + ybrad;
457                          orad = CHECKRAD*THRESHRAD*rad + 1;
458 +                        xrad = orad/x_c + xbrad;
459 +                        yrad = orad/y_r + ybrad;
460                          obarsize = 2*orad + 1;
461                  } else {
462                          xrad = CHECKRAD*rad/x_c + 1;
# Line 475 | Line 499 | scan2init()                    /* prepare scanline arrays */
499                          fputaspect(d, stdout);
500          }
501                                          /* record exposure */
502 <        d = bright(exposure);
502 >        d = (*ourbright)(exposure);
503          if (!FEQ(d,1.0))
504                  fputexpos(d, stdout);
505                                          /* record color correction */
# Line 502 | Line 526 | int  r;
526          int  ybot;
527          register int  c;
528                                          /* average input scanlines */
529 <        while (nextrow < r+orad && nextrow < nrows) {
529 >        while (nextrow <= r+orad && nextrow < nrows) {
530                  ybot = (long)nextrow*yres/nrows;
531                  for (c = 0; c < ncols; c++) {
532                          dobox(ctmp, (int)((long)c*xres/ncols),ybot, c,nextrow);
533 <                        greybar[nextrow%obarsize][c] = bright(ctmp);
533 >                        greybar[nextrow%obarsize][c] = (*ourbright)(ctmp);
534                  }
535                                          /* and zero output scanline */
536                  bzero((char *)scoutbar[nextrow%obarsize], ncols*sizeof(COLOR));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines