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.44 by greg, Sun Mar 24 19:00:33 2013 UTC vs.
Revision 2.49 by greg, Fri Feb 28 05:18:49 2020 UTC

# Line 361 | Line 361 | headline(                              /* process header string */
361          void    *p
362   )
363   {
364 <        char    fmt[32];
364 >        char    fmt[MAXFMTLEN];
365  
366          if (isheadid(s))
367                  return(0);
# Line 497 | Line 497 | addpicture(            /* add picture to output */
497          zin = (float *)malloc(scanlen(&tresolu)*sizeof(float));
498          if (zin == NULL)
499                  syserror(progname);
500 <        if ((zfd = open(zspec, O_RDONLY)) == -1) {
500 >        if ((zfd = open_float_depth(zspec, (long)tresolu.xr*tresolu.yr)) < 0) {
501                  double  zvalue;
502                  int     x;
503                  if (!isflt(zspec) || (zvalue = atof(zspec)) <= 0.0)
# Line 753 | Line 753 | movepixel(                             /* reposition image point */
753                  if (viewray(pt, tdir, &theirview, pos[0], pos[1]) < -FTINY)
754                          return(0);
755                  if ((!normdist) & (theirview.type == VT_PER))   /* adjust */
756 <                        pos[2] *= sqrt(1. + pos[0]*pos[0]*theirview.hn2
757 <                                        + pos[1]*pos[1]*theirview.vn2);
756 >                        pos[2] /= DOT(theirview.vdir, tdir);
757                  pt[0] += tdir[0]*pos[2];
758                  pt[1] += tdir[1]*pos[2];
759                  pt[2] += tdir[2]*pos[2];
760 <                viewloc(pos, &ourview, pt);
762 <                if (pos[2] <= 0)
760 >                if (viewloc(pos, &ourview, pt) <= 0)
761                          return(0);
762          }
763          if ((pos[0] < 0) | (pos[0] >= 1-FTINY) | (pos[1] < 0) | (pos[1] >= 1-FTINY))
# Line 1164 | Line 1162 | calstart(                    /* start fill calculation
1162          int     rval;
1163          char    **wp, *cp;
1164  
1165 <        if (PDesc.running) {
1165 >        if (PDesc.flags & PF_RUNNING) {
1166                  fprintf(stderr, "%s: too many calculations\n", progname);
1167                  exit(1);
1168          }
# Line 1199 | Line 1197 | calstart(                    /* start fill calculation
1197   static void
1198   caldone(void)                               /* done with calculation */
1199   {
1200 <        if (!PDesc.running)
1200 >        if (!(PDesc.flags & PF_RUNNING))
1201                  return;
1202          clearqueue();
1203          close_process(&PDesc);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines