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.1 by greg, Thu Feb 2 10:49:26 1989 UTC vs.
Revision 1.3 by greg, Tue Apr 11 21:39:00 1989 UTC

# Line 28 | Line 28 | double  rad = 0.0;             /* output pixel radius for filteri
28   int  nrows = 0;                 /* number of rows for output */
29   int  ncols = 0;                 /* number of columns for output */
30  
31 + double  xrat = 1.0;             /* ratio of input x size to output */
32 + double  yrat = 1.0;             /* ratio of input y size to output */
33 +
34   int  singlepass = 0;            /* true means skip first pass */
35  
36   int  avghot = 0;                /* true means average in bright spots */
# Line 86 | Line 89 | char  **argv;
89                  if (argv[i][0] == '-')
90                          switch (argv[i][1]) {
91                          case 'x':
92 <                                ncols = atoi(argv[++i]);
92 >                                i++;
93 >                                if (argv[i][0] == '/')
94 >                                        xrat = atof(argv[i]+1);
95 >                                else
96 >                                        ncols = atoi(argv[i]);
97                                  break;
98                          case 'y':
99 <                                nrows = atoi(argv[++i]);
99 >                                i++;
100 >                                if (argv[i][0] == '/')
101 >                                        yrat = atof(argv[i]+1);
102 >                                else
103 >                                        nrows = atoi(argv[i]);
104                                  break;
105                          case 'e':
106                                  if (argv[i+1][0] == '+' || argv[i+1][0] == '-')
# Line 180 | Line 191 | char  **argv;
191                  fprintf(stderr, "%s: bad picture size\n", progname);
192                  quit(1);
193          }
194 <        if (ncols <= 0)
195 <                ncols = xres;
196 <        if (nrows <= 0)
197 <                nrows = yres;
194 >        if (ncols > 0)
195 >                xrat = (double)xres/ncols;
196 >        else
197 >                ncols = xres/xrat + .5;
198 >        if (nrows > 0)
199 >                yrat = (double)yres/nrows;
200 >        else
201 >                nrows = yres/yrat + .5;
202  
203          if (singlepass) {
204                                          /* skip exposure, etc. */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines