93 fputc( w & 0xff, fp );
94 fputc( (w >> 8) & 0xff, fp );
102 GIFNextPixel( getpixel )
122 GIFEncode( FName, GWidth, GHeight, GInterlace, Background,
123 BitsPerPixel, Red, Green, Blue, GetPixel )
130 short int Red[], Green[], Blue[];
143 if (GInterlace) error(
"no support for interlace yet");
146 ColorMapSize = 1 << BitsPerPixel;
148 RWidth =
Width = GWidth;
149 RHeight =
Height = GHeight;
150 LeftOfs = TopOfs = 0;
152 Resolution = BitsPerPixel;
167 if( BitsPerPixel <= 1 )
170 InitCodeSize = BitsPerPixel;
185 fwrite(
"GIF87a", 1, 6, fp );
190 Putword( RWidth, fp );
191 Putword( RHeight, fp );
200 B |= (Resolution - 1) << 5;
205 B |= (BitsPerPixel - 1);
215 fputc( Background, fp );
225 for( i=0; i<ColorMapSize; i++ ) {
226 fputc( Red[i]>>8, fp );
227 fputc( Green[i]>>8, fp );
228 fputc( Blue[i]>>8, fp );
239 Putword( LeftOfs, fp );
240 Putword( TopOfs, fp );
241 Putword(
Width, fp );
256 fputc( InitCodeSize, fp );
261 compgif( InitCodeSize + 1, fp, GetPixel );
FILE * rle_open_f(char *prog_name, char *file_name, char *mode)