--- ray/src/common/image.c 1990/01/08 14:45:52 1.5 +++ ray/src/common/image.c 1990/01/09 11:37:50 1.7 @@ -65,6 +65,20 @@ register VIEW *v; } +normaspect(va, ap, xp, yp) /* fix pixel aspect or resolution */ +double va; /* view aspect ratio */ +double *ap; /* pixel aspect in (or out if 0) */ +int *xp, *yp; /* x and y resolution in (or out if *ap!=0) */ +{ + if (*ap <= FTINY) + *ap = va * *xp / *yp; /* compute pixel aspect */ + else if (va * *xp > *ap * *yp) + *xp = *yp / va * *ap; /* reduce x resolution */ + else + *yp = *xp * va / *ap; /* reduce y resolution */ +} + + viewray(orig, direc, v, x, y) /* compute ray origin and direction */ FVECT orig, direc; register VIEW *v;