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

Comparing ray/src/rt/srcdraw.c (file contents):
Revision 2.3 by greg, Sat Jun 8 21:16:04 1996 UTC vs.
Revision 2.6 by greg, Tue Feb 25 02:47:23 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1996 Regents of the University of California */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ LBL";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Draw small sources into image in case we missed them.
6 + *
7 + *  External symbols declared in ray.h
8   */
9  
10 + #include "copyright.h"
11 +
12   #include  "ray.h"
13  
14   #include  "view.h"
# Line 337 | Line 338 | int    rad;                            /* source sample size */
338                                          /* free old source list if one */
339          for (sp = sphead; sp != NULL; sp = sphead) {
340                  sphead = sp->next;
341 <                free((char *)sp);
341 >                free((void *)sp);
342          }
343                                          /* loop through all sources */
344          for (i = nsources; i--; ) {
# Line 356 | Line 357 | int    rad;                            /* source sample size */
357          }
358   }
359  
360 <                        /* add sources smaller than rad to computed subimage */
360 > void                    /* add sources smaller than rad to computed subimage */
361   drawsources(pic, zbf, x0, xsiz, y0, ysiz)
362   COLOR   *pic[];                         /* subimage pixel value array */
363   float   *zbf[];                         /* subimage distance array (opt.) */
# Line 366 | Line 367 | int    x0, xsiz, y0, ysiz;             /* origin and size of subimag
367          int     nsv, npv;
368          int     xmin, xmax, ymin, ymax, x, y;
369          FLOAT   cxy[2];
370 <        double  pa;
370 >        double  w;
371          RAY     sr;
372          register SPLIST *sp;
373          register int    i;
# Line 415 | Line 416 | int    x0, xsiz, y0, ysiz;             /* origin and size of subimag
416                                          continue;       /* missed/blocked */
417                                                          /* modify pixel */
418                                  if (zbf[y-y0] != NULL &&
419 <                                                sr.rt < zbf[y-y0][x-x0])
419 >                                                sr.rt < 0.999*zbf[y-y0][x-x0])
420                                          zbf[y-y0][x-x0] = sr.rt;
421 <                                pa = poly_area(ppoly, npv);
422 <                                scalecolor(sr.rcol, pa*hres*vres);
423 <                                scalecolor(pic[y-y0][x-x0], (1.-pa*hres*vres));
421 >                                else if (!bigdiff(sr.rcol, pic[y-y0][x-x0],
422 >                                                0.001)) /* source sample */
423 >                                        setcolor(pic[y-y0][x-x0], 0., 0., 0.);
424 >                                w = poly_area(ppoly, npv) * hres * vres;
425 >                                scalecolor(sr.rcol, w);
426 >                                scalecolor(pic[y-y0][x-x0], 1.-w);
427                                  addcolor(pic[y-y0][x-x0], sr.rcol);
428                          }
429          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines