#include <stdio.h>
#include "rle.h"
#include "rletogif.h"
Go to the source code of this file.
|
static void | BumpPixel () |
|
static void | Putword (int w, FILE *fp) |
|
int | GIFNextPixel (ifunptr getpixel) |
|
void | GIFEncode (char *FName, int GWidth, int GHeight, int GInterlace, int Background, int BitsPerPixel, Red, Green, Blue, ifunptr GetPixel) |
|
static void BumpPixel |
( |
| ) |
|
|
static |
void GIFEncode |
( |
char * |
FName, |
|
|
int |
GWidth, |
|
|
int |
GHeight, |
|
|
int |
GInterlace, |
|
|
int |
Background, |
|
|
int |
BitsPerPixel, |
|
|
Red |
, |
|
|
Green |
, |
|
|
Blue |
, |
|
|
ifunptr |
GetPixel |
|
) |
| |
Definition at line 122 of file gifencod.c.
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 );
200 B |= (Resolution - 1) << 5;
205 B |= (BitsPerPixel - 1);
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 );
256 fputc( InitCodeSize, fp );
261 compgif( InitCodeSize + 1, fp, GetPixel );
static unsigned int B[32]
int compgif(int code_size, FILE *os, ifunptr infun)
FILE * rle_open_f(const char *prog_name, const char *f_name, const char *mode)
static void Putword(int w, FILE *fp)
static void Putword |
( |
int |
w, |
|
|
FILE * |
fp |
|
) |
| |
|
static |
Definition at line 89 of file gifencod.c.
93 fputc( w & 0xff,
fp );
94 fputc( (w >> 8) & 0xff,
fp );