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

Comparing ray/src/px/oki20c.c (file contents):
Revision 1.10 by greg, Thu Apr 18 14:35:11 1991 UTC vs.
Revision 1.12 by greg, Mon Nov 11 14:01:31 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  
17
18   #define  NROWS          1440            /* 10" at 144 dpi */
19   #define  NCOLS          960             /* 8" at 120 dpi */
20  
# Line 69 | Line 69 | char  *fname;
69                  return(-1);
70          }
71                                  /* get picture dimensions */
72 <        if (fgetresolu(&xres, &yres, input) != (YMAJOR|YDECR)) {
72 >        if (fgetresolu(&xres, &yres, input) < 0) {
73                  fprintf(stderr, "%s: bad picture size\n", fname);
74                  return(-1);
75          }
# Line 143 | Line 143 | register int  x;
143   int  s;
144   {
145          static int  cerr[NCOLS][3];
146 <        static int  err[3];
146 >        static int  err[3], errp[3];
147          int  b;
148          register int  a, ison;
149  
150          a = sub_add(s);                 /* use additive primary */
151          b = col[a];
152 +        errp[a] = err[a];
153          err[a] += b + cerr[x][a];
154          ison = err[a] < 128;
155          if (!ison) err[a] -= 256;
156 <        cerr[x][a] = err[a] /= 2;
156 >        err[a] /= 3;
157 >        cerr[x][a] = err[a] + errp[a];
158          return(ison);
159   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines