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.30 by greg, Wed May 1 12:40:03 1991 UTC vs.
Revision 1.31 by greg, Mon May 6 15:19:03 1991 UTC

# Line 548 | Line 548 | getmono()                      /* get monochrome data */
548   {
549          register unsigned short *dp;
550          register int    x, err;
551 <        int     y;
551 >        int     y, errp;
552          rgbpixel        *inl;
553          short   *cerr;
554  
# Line 562 | Line 562 | getmono()                      /* get monochrome data */
562                  for (x = 0; x < xmax; x++) {
563                          if (!(x&0xf))
564                                  *++dp = 0;
565 +                        errp = err;
566                          err += rgb_bright(&inl[x]) + cerr[x];
567                          if (err > 127)
568                                  err -= 255;
569                          else
570                                  *dp |= 1<<(x&0xf);
571 <                        cerr[x] = err >>= 1;
571 >                        err /= 3;
572 >                        cerr[x] = err + errp;
573                  }
574          }
575          free((char *)inl);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines