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

Comparing ray/src/px/ra_gif.c (file contents):
Revision 2.1 by greg, Wed Mar 30 14:24:52 1994 UTC vs.
Revision 2.2 by greg, Tue May 3 10:06:32 1994 UTC

# Line 38 | Line 38 | extern BYTE  clrtab[][3];
38   extern int  getgifpix();
39  
40   COLR    *scanln;
41 + BYTE    *pixscan;
42  
43   int  xmax, ymax;                        /* picture size */
44  
# Line 45 | Line 46 | double gamv = 2.2;                     /* gamma correction */
46  
47   int  greyscale = 0;                     /* convert to B&W? */
48  
49 + int  dither = 1;                        /* dither colors? */
50 +
51   int  bradj = 0;                         /* brightness adjustment */
52  
53   char  *progname;
# Line 74 | Line 77 | char  *argv[];
77                          case 'b':
78                                  greyscale = 1;
79                                  break;
80 +                        case 'd':
81 +                                dither = !dither;
82 +                                break;
83                          case 'c':
84                                  ncolors = atoi(argv[++i]);
85                                  break;
# Line 154 | Line 160 | int  y;
160          if (bradj)
161                  shiftcolrs(scanln, xmax, bradj);
162          colrs_gambs(scanln, xmax);
163 +        if (pixscan != NULL)
164 +                dith_colrs(pixscan, scanln, xmax);
165   }
166  
167  
# Line 173 | Line 181 | int    nc;
181                  gmap[i] = clrtab[i][GRN];
182                  bmap[i] = clrtab[i][BLU];
183          }
184 +        if (dither && (pixscan = (BYTE *)malloc(xmax)) == NULL) {
185 +                fprintf(stderr, "%s: out of memory\n", progname);
186 +                exit(1);
187 +        }
188   }
189  
190  
# Line 198 | Line 210 | int  x, y;
210          getrow(y);
211          if (greyscale)
212                  return(normbright(scanln[x]));
213 +        if (pixscan != NULL)
214 +                return(pixscan[x]);
215          return(map_pixel(scanln[x]));
216   }
217  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines