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

Comparing ray/src/util/findglare.c (file contents):
Revision 1.12 by greg, Mon Mar 25 14:40:10 1991 UTC vs.
Revision 1.13 by greg, Tue Apr 2 14:29:15 1991 UTC

# Line 40 | Line 40 | int    hlim;                           /* central limit of horizontal */
40  
41   struct illum    *indirect;              /* array of indirect illuminances */
42  
43 + long    npixinvw;                       /* number of pixels in view */
44 + long    npixmiss;                       /* number of pixels missed */
45  
46 +
47   main(argc, argv)
48   int     argc;
49   char    *argv[];
# Line 223 | Line 226 | init()                         /* initialize global variables */
226          indirect = (struct illum *)calloc(nglardirs, sizeof(struct illum));
227          if (indirect == NULL)
228                  memerr("indirect illuminances");
229 +        npixinvw = npixmiss = 0L;
230          copystruct(&leftview, &ourview);
231          copystruct(&rightview, &ourview);
232          spinvector(leftview.vdir, ourview.vdir, ourview.vup, maxtheta);
# Line 276 | Line 280 | cleanup()                              /* close files, wait for children */
280                  close_pict();
281          if (octree != NULL)
282                  done_rtrace();
283 +        if (npixinvw < 100*npixmiss)
284 +                fprintf(stderr, "%s: warning -- missing %ld%% of samples\n",
285 +                                progname, 100L*npixmiss/npixinvw);
286   }
287  
288  
# Line 287 | Line 294 | int    x, y;
294  
295          if (x <= -hlim)                 /* left region */
296                  return(viewray(org, vd, &leftview,
297 <                                (x+hlim)/(2.*sampdens)+.5,
298 <                                y/(2.*sampdens)+.5));
297 >                                (double)(x+hlim)/(2*sampdens)+.5,
298 >                                (double)y/(2*sampdens)+.5));
299          if (x >= hlim)                  /* right region */
300                  return(viewray(org, vd, &rightview,
301 <                                (x-hlim)/(2.*sampdens)+.5,
302 <                                y/(2.*sampdens)+.5));
301 >                                (double)(x-hlim)/(2*sampdens)+.5,
302 >                                (double)y/(2*sampdens)+.5));
303                                                  /* central region */
304 <        if (viewray(org, vd, &ourview, .5, y/(2.*sampdens)+.5) < 0)
304 >        if (viewray(org, vd, &ourview, .5, (double)y/(2*sampdens)+.5) < 0)
305                  return(-1);
306          spinvector(vd, vd, ourview.vup, h_theta(x));
307          return(0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines