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.12 by greg, Fri Apr 12 10:28:34 1991 UTC vs.
Revision 1.14 by greg, Fri Apr 19 17:41:06 1991 UTC

# Line 50 | Line 50 | static SCAN    *hashtab[HSIZE];        /* scanline hash table */
50   static long     ncall = 0L;     /* number of calls to getpictscan */
51   static long     nread = 0L;     /* number of scanlines read */
52  
53 + static int      wrongformat = 0;
54 +
55   SCAN    *scanretire();
56  
57   extern long     ftell();
# Line 177 | Line 179 | FVECT  vd;
179  
180  
181   double
182 < getviewpix(vh, vv, se)          /* compute single view pixel */
182 > getviewpix(vh, vv)              /* compute single view pixel */
183   int     vh, vv;
182 SPANERR *se;
184   {
185          FVECT   dir;
186          float   rt_buf[6];
187          double  res;
188  
189 <        if (compdir(dir, vh, vv, se) < 0)
189 >        if (compdir(dir, vh, vv) < 0)
190                  return(-1.0);
191          npixinvw++;
192          if ((res = pict_val(dir)) >= 0.0)
# Line 212 | Line 213 | float  *vb;
213          float   rt_buf[6*MAXPIX];       /* rtrace send/receive buffer */
214          register int    n;              /* number of pixels in buffer */
215          short   buf_vh[MAXPIX];         /* pixel positions */
215        SPANERR sperr;
216          FVECT   dir;
217          register int    vh;
218  
# Line 221 | Line 221 | float  *vb;
221                  fprintf(stderr, "%s: computing view span at %d...\n",
222                                  progname, vv);
223   #endif
224        setspanerr(&sperr, vv);
224          n = 0;
225          for (vh = -hsize; vh <= hsize; vh++) {
226 <                if (compdir(dir, vh, vv, &sperr) < 0) { /* not in view */
226 >                if (compdir(dir, vh, vv) < 0) {         /* not in view */
227                          vb[vh+hsize] = -1.0;
228                          continue;
229                  }
# Line 290 | Line 289 | int    np;
289   getexpos(s)                     /* get exposure from header line */
290   char    *s;
291   {
292 +        char    fmt[32];
293 +
294          if (isexpos(s))
295                  exposure *= exposval(s);
296 +        else if (isformat(s)) {
297 +                formatval(fmt, s);
298 +                wrongformat = strcmp(fmt, COLRFMT);
299 +        }
300   }
301  
302  
# Line 303 | Line 308 | char   *fn;
308                  exit(1);
309          }
310          exposure = 1.0;
311 <        getheader(pictfp, getexpos);
312 <        if (fgetresolu(&pxsiz, &pysiz, pictfp) != (YMAJOR|YDECR)) {
313 <                fprintf("%s: bad picture resolution\n", fn);
311 >        getheader(pictfp, getexpos, NULL);
312 >        if (wrongformat ||
313 >                        fgetresolu(&pxsiz, &pysiz, pictfp) != (YMAJOR|YDECR)) {
314 >                fprintf("%s: bad picture format\n", fn);
315                  exit(1);
316          }
317          initscans();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines