--- ray/src/px/pfilt.c 1996/05/22 10:42:08 2.18 +++ ray/src/px/pfilt.c 2003/02/22 02:07:27 2.21 @@ -1,9 +1,6 @@ -/* Copyright (c) 1996 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: pfilt.c,v 2.21 2003/02/22 02:07:27 greg Exp $"; #endif - /* * pfilt.c - program to post-process picture file. * @@ -19,8 +16,6 @@ static char SCCSid[] = "$SunId$ LBL"; #include "view.h" -#include "resolu.h" - #include "paths.h" extern float *matchlamp(); @@ -92,8 +87,7 @@ main(argc, argv) int argc; char **argv; { - extern long ftell(); - extern int quit(), headline(); + extern int headline(); FILE *fin; float *lampcolor; char *lamptype = NULL; @@ -205,7 +199,7 @@ char **argv; case 'm': thresh = atof(argv[++i]); if (rad <= FTINY) - rad = 1.0; + rad = 0.6; break; case 'b': rad = thresh = 0.0; @@ -332,6 +326,7 @@ COLOR clr; double (*ourbright)() = rgb_bright; +int headline(s) /* process line from header */ char *s; { @@ -352,6 +347,7 @@ char *s; wrongformat = !globmatch(PICFMT, fmt); } else if (isview(s) && sscanview(&ourview, s) > 0) gotview++; + return(0); } @@ -399,7 +395,7 @@ FILE *in; } pass1scan(scan, i); } - free((char *)scan); + free((void *)scan); } @@ -414,7 +410,7 @@ FILE *in; scan2init(); yread = 0; for (r = 0; r < nrows; r++) { - ycent = (long)r*yres/nrows; + ycent = (r+.5)*yres/nrows; while (yread <= ycent+yrad) { if (yread < yres) { if (freadscan(scanin[yread%barsize], @@ -431,7 +427,7 @@ FILE *in; if (obarsize > 0) scan2sync(r); for (c = 0; c < ncols; c++) { - xcent = (long)c*xres/ncols; + xcent = (c+.5)*xres/ncols; if (thresh > FTINY) dothresh(xcent, ycent, c, r); else if (rad > FTINY) @@ -540,9 +536,9 @@ int r; register int c; /* average input scanlines */ while (nextrow <= r+orad && nextrow < nrows) { - ybot = (long)nextrow*yres/nrows; + ybot = (nextrow+.5)*yres/nrows; for (c = 0; c < ncols; c++) { - dobox(ctmp, (int)((long)c*xres/ncols),ybot, c,nextrow); + dobox(ctmp, (int)((c+.5)*xres/ncols),ybot, c,nextrow); greybar[nextrow%obarsize][c] = (*ourbright)(ctmp); } /* and zero output scanline */ @@ -571,6 +567,7 @@ scan2flush() /* flush output buffer */ } +void quit(code) /* remove temporary file and exit */ int code; {