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.41 by schorsch, Sun Mar 28 20:33:14 2004 UTC vs.
Revision 2.45 by greg, Mon May 20 21:52:06 2013 UTC

# Line 134 | Line 134 | main(                  /* interpolate pictures */
134          char    *expcomp = NULL;
135          int     i, an, rval;
136  
137 +        SET_DEFAULT_BINARY();
138 +        SET_FILE_BINARY(stdout);
139 +
140          progname = argv[0];
141  
142          for (an = 1; an < argc && argv[an][0] == '-'; an++) {
# Line 391 | Line 394 | nextview(                              /* get and set next view */
394   {
395          char    linebuf[256];
396          char    *err;
397 <        register int    i;
397 >        int     i;
398  
399          if (fp != NULL) {
400                  do                      /* get new view */
# Line 414 | Line 417 | nextview(                              /* get and set next view */
417                  avgview.vdir[i] += ourview.vdir[i];
418                  avgview.vup[i] += ourview.vup[i];
419          }
420 +        avgview.vdist += ourview.vdist;
421          avgview.horiz += ourview.horiz;
422          avgview.vert += ourview.vert;
423          avgview.hoff += ourview.hoff;
# Line 427 | Line 431 | nextview(                              /* get and set next view */
431   static void
432   compavgview(void)                               /* compute average view */
433   {
434 <        register int    i;
434 >        int     i;
435          double  f;
436  
437          if (nvavg < 2)
# Line 438 | Line 442 | compavgview(void)                              /* compute average view */
442                  avgview.vdir[i] *= f;
443                  avgview.vup[i] *= f;
444          }
445 +        avgview.vdist *= f;
446          avgview.horiz *= f;
447          avgview.vert *= f;
448          avgview.hoff *= f;
# Line 494 | Line 499 | addpicture(            /* add picture to output */
499                  syserror(progname);
500          if ((zfd = open(zspec, O_RDONLY)) == -1) {
501                  double  zvalue;
502 <                register int    x;
502 >                int     x;
503                  if (!isflt(zspec) || (zvalue = atof(zspec)) <= 0.0)
504                          syserror(zspec);
505                  for (x = scanlen(&tresolu); x-- > 0; )
# Line 553 | Line 558 | addpicture(            /* add picture to output */
558  
559   static int
560   pixform(                /* compute view1 to view2 matrix */
561 <        register MAT4   xfmat,
562 <        register VIEW   *vw1,
563 <        register VIEW   *vw2
561 >        MAT4    xfmat,
562 >        VIEW    *vw1,
563 >        VIEW    *vw2
564   )
565   {
566 <        double  m4t[4][4];
566 >        MAT4    m4t;
567  
568          if ((vw1->type != VT_PER) & (vw1->type != VT_PAR))
569                  return(0);
# Line 607 | Line 612 | addscanline(   /* add scanline to output */
612          FVECT   pos;
613          struct position lastx, newpos;
614          double  wt;
615 <        register int    x;
615 >        int     x;
616  
617          lastx.z = 0;
618          for (x = xl->max; x >= xl->min; x--) {
# Line 645 | Line 650 | addpixel(              /* fill in pixel parallelogram */
650          int     l1, l2, c1, c2;                 /* side lengths and counters */
651          int     p1isy;                          /* p0p1 along y? */
652          int     x1, y1;                         /* p1 position */
653 <        register int    x, y;                   /* final position */
653 >        int     x, y;                   /* final position */
654  
655                                          /* compute vector p0p1 */
656          if (fillo&F_FORE && ABS(p1->z-p0->z) <= zt) {
# Line 712 | Line 717 | addpixel(              /* fill in pixel parallelogram */
717  
718   static double
719   movepixel(                              /* reposition image point */
720 <        register FVECT  pos
720 >        FVECT   pos
721   )
722   {
723          FVECT   pt, tdir, odir;
# Line 748 | 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
752 <                                        + 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];
# Line 778 | Line 782 | movepixel(                             /* reposition image point */
782  
783   static int
784   getperim(               /* compute overlapping image area */
785 <        register struct bound   *xl,
785 >        struct bound    *xl,
786          struct bound    *yl,
787          float   *zline,
788          int     zfd
# Line 786 | Line 790 | getperim(              /* compute overlapping image area */
790   {
791          int     step;
792          FVECT   pos;
793 <        register int    x, y;
793 >        int     x, y;
794                                                  /* set up step size */
795          if (scanlen(&tresolu) < numscans(&tresolu))
796                  step = scanlen(&tresolu)/NSTEPS;
# Line 870 | Line 874 | backpicture(                   /* background fill algorithm */
874   {
875          int     *yback, xback;
876          int     y;
877 <        register int    x, i;
877 >        int     x, i;
878                                                          /* get back buffer */
879          yback = (int *)malloc(hresolu*sizeof(int));
880          if (yback == NULL)
# Line 977 | Line 981 | fillpicture(           /* paint in empty pixels using fill */
981          fillfunc_t *fill
982   )
983   {
984 <        register int    x, y;
984 >        int     x, y;
985  
986          for (y = 0; y < vresolu; y++)
987                  for (x = 0; x < hresolu; x++)
# Line 991 | Line 995 | fillpicture(           /* paint in empty pixels using fill */
995   static int
996   clipaft(void)                   /* perform aft clipping as indicated */
997   {
998 <        register int    x, y;
998 >        int     x, y;
999          int     adjtest = (ourview.type == VT_PER) & zisnorm;
1000          double  tstdist;
1001          double  yzn2, vx;
# Line 1030 | Line 1034 | addblur(void)                          /* add to blurred picture */
1034   {
1035          COLOR   cval;
1036          double  d;
1037 <        register int    i;
1037 >        int     i;
1038  
1039          if (!blurring)
1040                  return(0);
# Line 1070 | Line 1074 | static void
1074   writepicture(void)                              /* write out picture (alters buffer) */
1075   {
1076          int     y;
1077 <        register int    x;
1077 >        int     x;
1078          double  d;
1079  
1080          fprtresolu(hresolu, vresolu, stdout);
# Line 1113 | Line 1117 | writedistance(                 /* write out z file (alters buffer) *
1117          for (y = vresolu-1; y >= 0; y--) {
1118                  if (donorm) {
1119                          double  vx, yzn2, d;
1120 <                        register int    x;
1120 >                        int     x;
1121                          yzn2 = (y+.5)/vresolu + ourview.voff - .5;
1122                          yzn2 = 1. + yzn2*yzn2*ourview.vn2;
1123                          for (x = 0; x < hresolu; x++) {
# Line 1157 | Line 1161 | calstart(                    /* start fill calculation
1161          char    combuf[512];
1162          char    *argv[64];
1163          int     rval;
1164 <        register char   **wp, *cp;
1164 >        char    **wp, *cp;
1165  
1166          if (PDesc.running) {
1167                  fprintf(stderr, "%s: too many calculations\n", progname);
# Line 1221 | Line 1225 | clearqueue(void)                               /* process queue */
1225   {
1226          FVECT   orig, dir;
1227          float   fbuf[6*(PACKSIZ+1)];
1228 <        register float  *fbp;
1229 <        register int    i;
1228 >        float   *fbp;
1229 >        int     i;
1230          double  vx, vy;
1231  
1232          if (queuesiz == 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines