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.2 by greg, Tue Apr 11 17:22:05 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 >                                if (argv[i][2] == '/')
93 >                                        xrat = atof(argv[++i]);
94 >                                else
95 >                                        ncols = atoi(argv[++i]);
96                                  break;
97                          case 'y':
98 <                                nrows = atoi(argv[++i]);
98 >                                if (argv[i][2] == '/')
99 >                                        yrat = atof(argv[++i]);
100 >                                else
101 >                                        nrows = atoi(argv[++i]);
102                                  break;
103                          case 'e':
104                                  if (argv[i+1][0] == '+' || argv[i+1][0] == '-')
# Line 180 | Line 189 | char  **argv;
189                  fprintf(stderr, "%s: bad picture size\n", progname);
190                  quit(1);
191          }
192 <        if (ncols <= 0)
193 <                ncols = xres;
194 <        if (nrows <= 0)
195 <                nrows = yres;
192 >        if (ncols > 0)
193 >                xrat = (double)xres/ncols;
194 >        else
195 >                ncols = xres/xrat + .5;
196 >        if (nrows > 0)
197 >                yrat = (double)yres/nrows;
198 >        else
199 >                nrows = yres/yrat + .5;
200  
201          if (singlepass) {
202                                          /* skip exposure, etc. */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines