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.18 by greg, Mon Oct 28 08:10:18 1991 UTC vs.
Revision 1.19 by greg, Mon Nov 11 14:01:15 1991 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ LBL";
16  
17   #include  "color.h"
18  
19 + #include  "resolu.h"
20 +
21   extern char  *malloc();
22   extern float  *matchlamp();
23  
# Line 49 | Line 51 | char  *tfname = NULL;
51  
52   char  *lampdat = "lamp.tab";    /* lamp data file */
53  
54 + int  order;                     /* scanline ordering of input */
55   int  xres, yres;                /* resolution of input */
56   double  inpaspect = 1.0;        /* pixel aspect ratio of input */
57   int  correctaspect = 0;         /* aspect ratio correction? */
# Line 238 | Line 241 | char  **argv;
241                                          /* add new header info. */
242          printargs(i, argv, stdout);
243                                          /* get picture size */
244 <        if (fgetresolu(&xres, &yres, fin) != (YMAJOR|YDECR)) {
244 >        if ((order = fgetresolu(&xres, &yres, fin)) < 0) {
245                  fprintf(stderr, "%s: bad picture size\n", progname);
246                  quit(1);
247          }
248 +        if (!(order & YMAJOR))
249 +                inpaspect = 1.0/inpaspect;
250                                          /* compute output resolution */
251          if (ncols <= 0)
252                  ncols = x_c*xres + .5;
# Line 419 | Line 424 | scan2init()                    /* prepare scanline arrays */
424          }
425                                          /* record pixel aspect ratio */
426          if (!correctaspect) {
427 <                d = x_c / y_r;
427 >                d = order & YMAJOR ? x_c/y_r : y_r/x_c ;
428                  if (!FEQ(d,1.0))
429                          fputaspect(d, stdout);
430          }
# Line 435 | Line 440 | scan2init()                    /* prepare scanline arrays */
440                  fputcolcor(ctmp, stdout);
441          printf("\n");
442                                          /* write out resolution */
443 <        fputresolu(YMAJOR|YDECR, ncols, nrows, stdout);
443 >        fputresolu(order, ncols, nrows, stdout);
444   }
445  
446  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines