home *** CD-ROM | disk | FTP | other *** search
- /*
- gif.h
-
- gifheader.c, gifbmap.c, and gif.h are based on "giftoppm"
- of David Koblas.
- They are modified by T. Ogihara. (1996)
- */
-
- /* +-------------------------------------------------------------------+ */
- /* | Copyright 1990, David Koblas. | */
- /* | Permission to use, copy, modify, and distribute this software | */
- /* | and its documentation for any purpose and without fee is hereby | */
- /* | granted, provided that the above copyright notice appear in all | */
- /* | copies and that both that copyright notice and this permission | */
- /* | notice appear in supporting documentation. This software is | */
- /* | provided "as is" without express or implied warranty. | */
- /* +-------------------------------------------------------------------+ */
-
- #include <stdio.h>
- #include <libc.h>
- #include <objc/objc.h>
- #include "common.h"
-
- #define INTERLACE 0x40
- #define LOCALCOLORMAP 0x80
- #define TRANSPARENCY 0x01
- #define BitSet(byte, bit) (((byte) & (bit)) == (bit))
- #define ReadOK(file,buffer,len) (fread(buffer, len, 1, file) != 0)
-
- typedef struct {
- int width;
- int height;
- int colors;
- int bits; /* bits per sample */
- int transp; /* Transparency Index */
- unsigned short Resolution;
- unsigned short Background;
- unsigned short AspectRatio;
- BOOL colormap;
- BOOL interlace;
- BOOL isgray;
- char ver[4];
- paltype palette[256];
- unsigned char *memo;
- } gifHeader;
-
- gifHeader *loadGifHeader(FILE *fd, int *errcode);
- void freeGifHeader(gifHeader *gh);
- commonInfo *gifInfo(gifHeader *);
-
- int gifGetImage(FILE *, gifHeader *, unsigned char **);
- int GetDataBlock(FILE *, unsigned char *);
- int initGifLZW(FILE *);
- int LWZReadByte(FILE *);
-