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

Comparing ray/src/px/pinterp.c (file contents):
Revision 2.28 by greg, Mon Jun 24 09:17:47 1996 UTC vs.
Revision 2.32 by gwlarson, Fri Jul 16 16:11:31 1999 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1995 Regents of the University of California */
1 > /* Copyright (c) 1999 Silicon Graphics, Inc. */
2  
3   #ifndef lint
4 < static char SCCSid[] = "$SunId$ LBL";
4 > static char SCCSid[] = "$SunId$ SGI";
5   #endif
6  
7   /*
# Line 39 | Line 39 | static char SCCSid[] = "$SunId$ LBL";
39  
40   #define PACKSIZ         256             /* max. calculation packet size */
41  
42 < #define RTCOM           "rtrace -h- -ovl -fff "
42 > #define RTCOM           "rtrace -h- -ovl -fff -ld- -i- -I- "
43  
44   #define ABS(x)          ((x)>0?(x):-(x))
45  
# Line 328 | Line 328 | userr:
328   }
329  
330  
331 + int
332   headline(s)                             /* process header string */
333   char    *s;
334   {
335          char    fmt[32];
336  
337          if (isheadid(s))
338 <                return;
338 >                return(0);
339          if (formatval(fmt, s)) {
340                  if (globmatch(ourfmt, fmt)) {
341                          wrongformat = 0;
342                          strcpy(ourfmt, fmt);
343                  } else
344                          wrongformat = 1;
345 <                return;
345 >                return(0);
346          }
347          if (nvavg < 2) {
348                  putc('\t', stdout);
# Line 349 | Line 350 | char   *s;
350          }
351          if (isexpos(s)) {
352                  theirexp *= exposval(s);
353 <                return;
353 >                return(0);
354          }
355          if (isview(s) && sscanview(&theirview, s) > 0)
356                  gotview++;
357 +        return(0);
358   }
359  
360  
# Line 672 | Line 674 | register FVECT pos;
674   {
675          FVECT   pt, tdir, odir;
676          double  d;
675        register int    i;
677          
678          if (pos[2] <= 0)                /* empty pixel */
679                  return(0);
# Line 717 | Line 718 | register FVECT pos;
718                  return(0);
719          if (!averaging)
720                  return(1);
721 <        if (ourview.type == VT_PAR)             /* compute our direction */
722 <                VCOPY(odir, ourview.vdir);
723 <        else
724 <                for (i = 0; i < 3; i++)
725 <                        odir[i] = (pt[i] - ourview.vp[i])/pos[2];
726 <        d = DOT(odir,tdir);                     /* compute pixel weight */
727 <        if (d >= 1.-1./MAXWT/MAXWT)
721 >                                                /* compute pixel weight */
722 >        if (ourview.type == VT_PAR) {
723 >                d = DOT(ourview.vdir,tdir);
724 >                d = 1. - d*d;
725 >        } else {
726 >                VSUB(odir, pt, ourview.vp);
727 >                d = DOT(odir,tdir);
728 >                d = 1. - d*d/DOT(odir,odir);
729 >        }
730 >        if (d <= 1./MAXWT/MAXWT)
731                  return(MAXWT);          /* clip to maximum weight */
732 <        return(1./sqrt(1.-d));
732 >        return(1./sqrt(d));
733   }
734  
735  
# Line 1169 | Line 1173 | clearqueue()                           /* process queue */
1173          }
1174                                          /* mark end and get results */
1175          bzero((char *)fbp, 6*sizeof(float));
1176 <        if (process(PDesc, fbuf, fbuf, 4*sizeof(float)*queuesiz,
1176 >        if (process(PDesc, fbuf, fbuf, 4*sizeof(float)*(queuesiz+1),
1177                          6*sizeof(float)*(queuesiz+1)) !=
1178 <                        4*sizeof(float)*queuesiz) {
1178 >                        4*sizeof(float)*(queuesiz+1)) {
1179                  fprintf(stderr, "%s: error reading from rtrace process\n",
1180                                  progname);
1181                  exit(1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines