ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/image.c
(Generate patch)

Comparing ray/src/common/image.c (file contents):
Revision 1.6 by greg, Tue Jan 9 09:08:09 1990 UTC vs.
Revision 1.8 by greg, Tue Jan 16 11:29:43 1990 UTC

# Line 65 | Line 65 | register VIEW  *v;
65   }
66  
67  
68 < normaspect(vp, ap, xp, yp)              /* fix pixel aspect or resolution */
69 < VIEW  *vp;
70 < double  *ap;
71 < int  *xp, *yp;
68 > normaspect(va, ap, xp, yp)              /* fix pixel aspect or resolution */
69 > double  va;                     /* view aspect ratio */
70 > double  *ap;                    /* pixel aspect in (or out if 0) */
71 > int  *xp, *yp;                  /* x and y resolution in (or out if *ap!=0) */
72   {
73        double  va = viewaspect(vp);
74
73          if (*ap <= FTINY)
74 <                *ap = (double)*yp / *xp / va;   /* compute pixel aspect */
74 >                *ap = va * *xp / *yp;           /* compute pixel aspect */
75          else if (va * *xp > *ap * *yp)
76                  *xp = *yp / va * *ap;           /* reduce x resolution */
77          else
# Line 260 | Line 258 | char  *s;
258  
259  
260   int
261 < viewfile(fname, vp)                     /* get view from file */
261 > viewfile(fname, vp, xp, yp)             /* get view from file */
262   char  *fname;
263   VIEW  *vp;
264 + int  *xp, *yp;
265   {
266          extern char  *progname;
267          FILE  *fp;
# Line 275 | Line 274 | VIEW  *vp;
274          gothview = 0;
275  
276          getheader(fp, gethview);
277 +
278 +        if (xp != NULL && yp != NULL
279 +                        && fgetresolu(xp, yp, fp) == -1)
280 +                gothview = 0;
281  
282          fclose(fp);
283  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines