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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.44 by greg, Wed Feb 14 15:18:05 1996 UTC vs.
Revision 2.45 by greg, Fri Mar 15 21:02:09 1996 UTC

# Line 6 | Line 6 | static char SCCSid[] = "$SunId$ LBL";
6  
7   /*
8   *  rpict.c - routines and variables for picture generation.
9 *
10 *     8/14/85
9   */
10  
11   #include  "ray.h"
# Line 425 | Line 423 | char  *zfile, *oldfile;
423                                  hres, ypos, hstep);
424                                                          /* fill bar */
425                  fillscanbar(scanbar, zbar, hres, ypos, ystep);
426 +                                                        /* add bitty sources */
427 +                drawsources(&ourview, hres, vres, scanbar, zbar,
428 +                                0, hres, ypos, ystep, psample);
429                                                          /* write it out */
430   #ifndef  BSD
431                  signal(SIGCONT, SIG_IGN);       /* don't interrupt writes */
# Line 489 | Line 490 | int  xres, y, xstep;
490          int  bl = xstep, b = xstep;
491          double  z;
492          register int  i;
493 <        
493 >
494          z = pixvalue(scanline[0], 0, y);
495          if (zline) zline[0] = z;
496                                  /* zig-zag start for quincunx pattern */
# Line 523 | Line 524 | int  xres, y, ysize;
524          float  zline[MAXDIV+1];
525          int  b = ysize;
526          register int  i, j;
527 <        
527 >
528          for (i = 0; i < xres; i++) {
528                
529                  copycolor(vline[0], scanbar[0][i]);
530                  copycolor(vline[ysize], scanbar[ysize][i]);
531                  if (zbar[0]) {
532                          zline[0] = zbar[0][i];
533                          zline[ysize] = zbar[ysize][i];
534                  }
535                
535                  b = fillsample(vline, zbar[0] ? zline : (float *)NULL,
536                                  i, y, 0, ysize, b/2);
537 <                
537 >
538                  for (j = 1; j < ysize; j++)
539                          copycolor(scanbar[j][i], vline[j]);
540                  if (zbar[0])
# Line 558 | Line 557 | int  b;
557          COLOR  ctmp;
558          int  ncut;
559          register int  len;
560 <        
560 >
561          if (xlen > 0)                   /* x or y length is zero */
562                  len = xlen;
563          else
564                  len = ylen;
565 <                
565 >
566          if (len <= 1)                   /* limit recursion */
567                  return(0);
568 <        
569 <        if (b > 0
570 <        || (zline && 2.*fabs(zline[0]-zline[len]) > maxdiff*(zline[0]+zline[len]))
568 >
569 >        if (b > 0 ||
570 >        (zline && 2.*fabs(zline[0]-zline[len]) > maxdiff*(zline[0]+zline[len]))
571                          || bigdiff(colline[0], colline[len], maxdiff)) {
572 <        
572 >
573                  z = pixvalue(colline[len>>1], x + (xlen>>1), y + (ylen>>1));
574                  if (zline) zline[len>>1] = z;
575                  ncut = 1;
577                
576          } else {                                        /* interpolate */
579        
577                  copycolor(colline[len>>1], colline[len]);
578                  ratio = (double)(len>>1) / len;
579                  scalecolor(colline[len>>1], ratio);
# Line 590 | Line 587 | int  b;
587          }
588                                                          /* recurse */
589          ncut += fillsample(colline, zline, x, y, xlen>>1, ylen>>1, (b-1)/2);
590 <        
590 >
591          ncut += fillsample(colline+(len>>1),
592                          zline ? zline+(len>>1) : (float *)NULL,
593                          x+(xlen>>1), y+(ylen>>1),
# Line 620 | Line 617 | int  x, y;                     /* pixel position */
617          rayvalue(&thisray);                     /* trace ray */
618  
619          copycolor(col, thisray.rcol);           /* return color */
620 <        
620 >
621          return(thisray.rt);                     /* return distance */
622   }
623  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines