--- ray/src/px/pfilt.c 1990/01/09 17:58:35 1.9 +++ ray/src/px/pfilt.c 1990/11/28 11:13:23 1.12 @@ -46,6 +46,7 @@ char *tfname = NULL; int xres, yres; /* resolution of input */ double inpaspect = 1.0; /* pixel aspect ratio of input */ +int correctaspect = 0; /* aspect ratio correction? */ int xrad; /* x window size */ int yrad; /* y window size */ @@ -103,6 +104,9 @@ char **argv; } else nrows = atoi(argv[i]); break; + case 'c': + correctaspect = !correctaspect; + break; case 'p': i++; outaspect = atof(argv[i]); @@ -281,6 +285,7 @@ FILE *in; fprintf(stderr, "%s: warning - partial frame (%d%%)\n", progname, 100*i/yres); yres = i; + y_r = (double)nrows/yres; break; } pass1scan(scan, i); @@ -326,6 +331,12 @@ FILE *in; quit(1); } } + /* skip leftovers */ + while (yread < yres) { + if (freadscan(scanin[0], xres, in) < 0) + break; + yread++; + } } @@ -361,9 +372,11 @@ scan2init() /* prepare scanline arrays */ quit(1); } /* record pixel aspect and exposure */ - d = x_c / y_r; - if (d < .99 || d > 1.01) - fputaspect(d, stdout); + if (!correctaspect) { + d = x_c / y_r; + if (d < .99 || d > 1.01) + fputaspect(d, stdout); + } d = bright(exposure); if (d < .995 || d > 1.005) fputexpos(d, stdout);