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

Comparing ray/src/px/x11image.c (file contents):
Revision 1.5 by greg, Wed Mar 7 11:39:26 1990 UTC vs.
Revision 1.6 by greg, Mon Mar 12 15:14:53 1990 UTC

# Line 601 | Line 601 | getmono()                      /* get monochrome data */
601          register unsigned char  *dp;
602          register int    x, err;
603          int     y;
604 <        rgbpixel        *inline;
604 >        rgbpixel        *inl;
605          short   *cerr;
606  
607 <        if ((inline = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL
607 >        if ((inl = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL
608                          || (cerr = (short *)calloc(xmax,sizeof(short))) == NULL)
609                  quit("out of memory in getmono");
610          dp = ourdata - 1;
611          for (y = 0; y < ymax; y++) {
612 <                picreadline3(y, inline);
612 >                picreadline3(y, inl);
613                  err = 0;
614                  for (x = 0; x < xmax; x++) {
615                          if (!(x&7))
616                                  *++dp = 0;
617 <                        err += rgb_bright(&inline[x]) + cerr[x];
617 >                        err += rgb_bright(&inl[x]) + cerr[x];
618                          if (err > 127)
619                                  err -= 255;
620                          else
# Line 622 | Line 622 | getmono()                      /* get monochrome data */
622                          cerr[x] = err >>= 1;
623                  }
624          }
625 <        free((char *)inline);
625 >        free((char *)inl);
626          free((char *)cerr);
627   }
628  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines