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

Comparing ray/src/util/glareval.c (file contents):
Revision 1.20 by greg, Tue Jul 30 12:56:36 1991 UTC vs.
Revision 1.21 by greg, Mon Nov 11 15:09:42 1991 UTC

# Line 9 | Line 9 | static char SCCSid[] = "$SunId$ LBL";
9   */
10  
11   #include "glare.h"
12 + #include "resolu.h"
13                                          /* maximum rtrace buffer size */
14   #define MAXPIX          (4096/(6*sizeof(float)))
15  
# Line 153 | Line 154 | pict_val(vd)                   /* find picture value for view directio
154   FVECT   vd;
155   {
156          FVECT   pp;
157 <        double  vpx, vpy, vpz;
157 >        FVECT   ip;
158          COLOR   res;
159  
160          if (pictfp == NULL)
# Line 161 | Line 162 | FVECT  vd;
162          pp[0] = pictview.vp[0] + vd[0];
163          pp[1] = pictview.vp[1] + vd[1];
164          pp[2] = pictview.vp[2] + vd[2];
165 <        viewpixel(&vpx, &vpy, &vpz, &pictview, pp);
166 <        if (vpz <= FTINY || vpx < 0. || vpx >= 1. || vpy < 0. || vpy >= 1.)
165 >        viewloc(ip, &pictview, pp);
166 >        if (ip[2] <= FTINY || ip[0] < 0. || ip[0] >= 1. ||
167 >                        ip[1] < 0. || ip[1] >= 1.)
168                  return(-1.0);
169 <        colr_color(res, getpictscan((int)(vpy*pysiz))[(int)(vpx*pxsiz)]);
169 >        colr_color(res, getpictscan((int)(ip[1]*pysiz))[(int)(ip[0]*pxsiz)]);
170          return(luminance(res)/exposure);
171   }
172  
# Line 293 | Line 295 | char   *fn;
295          }
296          exposure = 1.0;
297          getheader(pictfp, getexpos, NULL);
298 <        if (wrongformat ||
299 <                        fgetresolu(&pxsiz, &pysiz, pictfp) != (YMAJOR|YDECR)) {
298 <                fprintf("%s: bad picture format\n", fn);
298 >        if (wrongformat || !fscnresolu(&pxsiz, &pysiz, pictfp)) {
299 >                fprintf(stderr, "%s: incompatible picture format\n", fn);
300                  exit(1);
301          }
302          initscans();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines