8 #define ARGS(alist) alist
10 #define ARGS(alist) ()
18 #define put_byte(A) (*put_b)((byte)(A)); Nbyte++
20 typedef unsigned char byte;
63 long GIFencode(Width, Height, Ncol,
R,
G,
B, ScLine, get_scline, pb)
64 int Width, Height, Ncol;
65 byte R[], G[], B[], ScLine[];
66 void (*get_scline)
ARGS((
int,
int, byte *)), (*pb)
ARGS((byte));
69 int ncol, i,
x,
y, disp, Code,
K;
74 if (Width <= 0 || Width > 4096 || Height <= 0 || Height > 4096) {
76 "\nGIFencode: incorrect image size: %d x %d\n", Width, Height);
80 if (Ncol <= 0 || Ncol > 256) {
81 fprintf(stderr,
"\nGIFencode: wrong number of colors: %d\n", Ncol);
126 for (i=0; i<Ncol; i++) {
131 for (; i<ncol; i++) {
153 for (y=0; y<Height; y++) {
154 (*get_scline)(
y, Width, ScLine);
160 CodeK = ((long) K <<
BITS) + Code;
161 i = (K <<
SHIFT) ^ Code;
171 if (i == 0) disp = 1;
211 static unsigned long masks[] = { 0x0000,
212 0x0001, 0x0003, 0x0007, 0x000F,
213 0x001F, 0x003F, 0x007F, 0x00FF,
214 0x01FF, 0x03FF, 0x07FF, 0x0FFF,
215 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
static void output(int code)
long GIFencode(void *int, void *int, void *int, R, G, B, ScLine, void *get_scline, pb)
static long HashTab[HSIZE]
static int CodeTab[HSIZE]
static unsigned long masks[]
static unsigned long cur_accum
typedef void((*Func_t)())
static void put_short(int word)
static void char_out(int c)