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

Comparing ray/src/px/mt160r.c (file contents):
Revision 1.7 by greg, Thu Apr 18 14:35:09 1991 UTC vs.
Revision 2.1 by greg, Tue Nov 12 16:04:57 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 13 | Line 13 | static char SCCSid[] = "$SunId$ LBL";
13   #include  <stdio.h>
14  
15   #include  "color.h"
16 + #include  "resolu.h"
17  
18   #define  NCOLS          880             /* for wide carriage */
19  
# Line 54 | Line 55 | char  *fname;
55                  return(-1);
56          }
57                                  /* get picture dimensions */
58 <        if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) {
58 >        if (fgetresolu(&xres, &yres, input) < 0) {
59                  fprintf(stderr, "%s: bad picture size\n", fname);
60                  return(-1);
61          }
# Line 118 | Line 119 | COLR  clr;
119   register int  x;
120   {
121          static int  cerr[NCOLS];
122 <        static int  err;
122 >        static int  err, errp;
123          int  b;
124          register int  isblack;
125  
126          b = normbright(clr);
127 +        errp = err;
128          err += b + cerr[x];
129          isblack = err < 128;
130          if (!isblack) err -= 256;
131 <        cerr[x] = err /= 2;
131 >        err /= 3;
132 >        cerr[x] = err + errp;
133          return(isblack);
134   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines