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

Comparing ray/src/px/ximage.c (file contents):
Revision 1.21 by greg, Mon Jan 8 14:47:11 1990 UTC vs.
Revision 1.25 by greg, Sat Oct 13 21:31:45 1990 UTC

# Line 407 | Line 407 | XKeyEvent  *ekey;
407                          XFeep(0);
408                          return(-1);
409                  }
410 <                viewray(rorg, rdir, &ourview, (ekey->x-xoff+.5)/xmax,
411 <                                (ymax-1-ekey->y+yoff+.5)/ymax);
410 >                if (viewray(rorg, rdir, &ourview, (ekey->x-xoff+.5)/xmax,
411 >                                (ymax-1-ekey->y+yoff+.5)/ymax) < 0)
412 >                        return(-1);
413                  printf("%e %e %e ", rorg[0], rorg[1], rorg[2]);
414                  printf("%e %e %e\n", rdir[0], rdir[1], rdir[2]);
415                  fflush(stdout);
# Line 542 | Line 543 | getmono()                      /* get monochrome data */
543          register unsigned short *dp;
544          register int    x, err;
545          int     y;
546 <        rgbpixel        *inline;
546 >        rgbpixel        *inl;
547          short   *cerr;
548  
549 <        if ((inline = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL
549 >        if ((inl = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL
550                          || (cerr = (short *)calloc(xmax,sizeof(short))) == NULL)
551                  quit("out of memory in getmono");
552          dp = ourras->data.m - 1;
553          for (y = 0; y < ymax; y++) {
554 <                picreadline3(y, inline);
554 >                picreadline3(y, inl);
555                  err = 0;
556                  for (x = 0; x < xmax; x++) {
557                          if (!(x&0xf))
558                                  *++dp = 0;
559 <                        err += rgb_bright(&inline[x]) + cerr[x];
559 >                        err += rgb_bright(&inl[x]) + cerr[x];
560                          if (err > 127)
561                                  err -= 255;
562                          else
# Line 563 | Line 564 | getmono()                      /* get monochrome data */
564                          cerr[x] = err >>= 1;
565                  }
566          }
567 <        free((char *)inline);
567 >        free((char *)inl);
568          free((char *)cerr);
569   }
570  
# Line 656 | Line 657 | register rgbpixel  *l3;
657          if (getscan(y) < 0)
658                  quiterr("cannot seek for picreadline");
659                                                          /* convert scanline */
660 <        if (scale)
660 <                for (i = 0; i < xmax; i++)
661 <                        if (scanline[i][EXP])
662 <                                scanline[i][EXP] += scale;
663 <        normcolrs(scanline, xmax);
660 >        normcolrs(scanline, xmax, scale);
661          for (i = 0; i < xmax; i++) {
662                  l3[i].r = scanline[i][RED];
663                  l3[i].g = scanline[i][GRN];
# Line 673 | Line 670 | picwriteline(y, l)             /* add 8-bit scanline to image */
670   int  y;
671   pixel  *l;
672   {
673 <        bcopy(l, ourras->data.bz+BZPixmapSize(xmax,y), BZPixmapSize(xmax,1));
673 >        bcopy((char *)l, (char *)ourras->data.bz+BZPixmapSize(xmax,y), BZPixmapSize(xmax,1));
674   }
675  
676  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines