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.18 by greg, Wed May 22 10:42:08 1996 UTC vs.
Revision 2.21 by greg, Sat Feb 22 02:07:27 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1996 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   *  pfilt.c - program to post-process picture file.
6   *
# Line 19 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include  "view.h"
18  
22 #include  "resolu.h"
23
19   #include  "paths.h"
20  
21   extern float  *matchlamp();
# Line 92 | Line 87 | main(argc, argv)
87   int  argc;
88   char  **argv;
89   {
90 <        extern long  ftell();
96 <        extern int  quit(), headline();
90 >        extern int  headline();
91          FILE  *fin;
92          float  *lampcolor;
93          char  *lamptype = NULL;
# Line 205 | Line 199 | char  **argv;
199                          case 'm':
200                                  thresh = atof(argv[++i]);
201                                  if (rad <= FTINY)
202 <                                        rad = 1.0;
202 >                                        rad = 0.6;
203                                  break;
204                          case 'b':
205                                  rad = thresh = 0.0;
# Line 332 | Line 326 | COLOR  clr;
326   double  (*ourbright)() = rgb_bright;
327  
328  
329 + int
330   headline(s)                             /* process line from header */
331   char  *s;
332   {
# Line 352 | Line 347 | char  *s;
347                          wrongformat = !globmatch(PICFMT, fmt);
348          } else if (isview(s) && sscanview(&ourview, s) > 0)
349                  gotview++;
350 +        return(0);
351   }
352  
353  
# Line 399 | Line 395 | FILE  *in;
395                  }
396                  pass1scan(scan, i);
397          }
398 <        free((char *)scan);
398 >        free((void *)scan);
399   }
400  
401  
# Line 414 | Line 410 | FILE  *in;
410          scan2init();
411          yread = 0;
412          for (r = 0; r < nrows; r++) {
413 <                ycent = (long)r*yres/nrows;
413 >                ycent = (r+.5)*yres/nrows;
414                  while (yread <= ycent+yrad) {
415                          if (yread < yres) {
416                                  if (freadscan(scanin[yread%barsize],
# Line 431 | Line 427 | FILE  *in;
427                  if (obarsize > 0)
428                          scan2sync(r);
429                  for (c = 0; c < ncols; c++) {
430 <                        xcent = (long)c*xres/ncols;
430 >                        xcent = (c+.5)*xres/ncols;
431                          if (thresh > FTINY)
432                                  dothresh(xcent, ycent, c, r);
433                          else if (rad > FTINY)
# Line 540 | Line 536 | int  r;
536          register int  c;
537                                          /* average input scanlines */
538          while (nextrow <= r+orad && nextrow < nrows) {
539 <                ybot = (long)nextrow*yres/nrows;
539 >                ybot = (nextrow+.5)*yres/nrows;
540                  for (c = 0; c < ncols; c++) {
541 <                        dobox(ctmp, (int)((long)c*xres/ncols),ybot, c,nextrow);
541 >                        dobox(ctmp, (int)((c+.5)*xres/ncols),ybot, c,nextrow);
542                          greybar[nextrow%obarsize][c] = (*ourbright)(ctmp);
543                  }
544                                          /* and zero output scanline */
# Line 571 | Line 567 | scan2flush()                   /* flush output buffer */
567   }
568  
569  
570 + void
571   quit(code)              /* remove temporary file and exit */
572   int  code;
573   {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines