| 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 */ |
| 31 |
> |
double x_c = 1.0; /* ratio of output x size to input */ |
| 32 |
> |
double y_r = 1.0; /* ratio of output y size to input */ |
| 33 |
|
|
| 34 |
|
int singlepass = 0; /* true means skip first pass */ |
| 35 |
|
|
| 47 |
|
|
| 48 |
|
int xres, yres; /* resolution of input */ |
| 49 |
|
|
| 50 |
– |
double x_c, y_r; /* conversion factors */ |
| 51 |
– |
|
| 50 |
|
int xrad; /* x window size */ |
| 51 |
|
int yrad; /* y window size */ |
| 52 |
|
|
| 89 |
|
case 'x': |
| 90 |
|
i++; |
| 91 |
|
if (argv[i][0] == '/') |
| 92 |
< |
xrat = atof(argv[i]+1); |
| 92 |
> |
x_c = 1.0/atof(argv[i]+1); |
| 93 |
|
else |
| 94 |
|
ncols = atoi(argv[i]); |
| 95 |
|
break; |
| 96 |
|
case 'y': |
| 97 |
|
i++; |
| 98 |
|
if (argv[i][0] == '/') |
| 99 |
< |
yrat = atof(argv[i]+1); |
| 99 |
> |
y_r = 1.0/atof(argv[i]+1); |
| 100 |
|
else |
| 101 |
|
nrows = atoi(argv[i]); |
| 102 |
|
break; |
| 190 |
|
quit(1); |
| 191 |
|
} |
| 192 |
|
if (ncols > 0) |
| 193 |
< |
xrat = (double)xres/ncols; |
| 193 |
> |
x_c = (double)ncols/xres; |
| 194 |
|
else |
| 195 |
< |
ncols = xres/xrat + .5; |
| 195 |
> |
ncols = x_c*xres + .5; |
| 196 |
|
if (nrows > 0) |
| 197 |
< |
yrat = (double)yres/nrows; |
| 197 |
> |
y_r = (double)nrows/yres; |
| 198 |
|
else |
| 199 |
< |
nrows = yres/yrat + .5; |
| 199 |
> |
nrows = y_r*yres + .5; |
| 200 |
|
|
| 201 |
|
if (singlepass) { |
| 202 |
|
/* skip exposure, etc. */ |
| 309 |
|
{ |
| 310 |
|
double e; |
| 311 |
|
register int i; |
| 314 |
– |
|
| 315 |
– |
x_c = (double)ncols/xres; |
| 316 |
– |
y_r = (double)nrows/yres; |
| 312 |
|
|
| 313 |
|
if (rad <= 0.0) { |
| 314 |
|
xrad = xres/ncols/2 + 1; |