annotate src/gif_lib.h @ 158:558dfa75ffb3

Added tag r20-3b5 for changeset 6b37e6ddd302
author cvs
date Mon, 13 Aug 2007 09:40:48 +0200
parents 376386a54a3c
children 850242ba4a81
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Synched up with: Not in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 * In order to make life a little bit easier when using the GIF file format, *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 * this library was written, and which does all the dirty work... *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 * *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 * Written by Gershon Elber, Jun. 1989 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 * Hacks by Eric S. Raymond, Sep. 1992 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 *******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 * History: *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 * 14 Jun 89 - Version 1.0 by Gershon Elber. *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 * 3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names). *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 * 15 Sep 90 - Version 2.0 by Eric S. Raymond (Changes to suoport GIF slurp) *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 #ifndef GIF_LIB_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 #define GIF_LIB_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 #define GIF_LIB_VERSION " Version 2.0, "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 #define GIF_ERROR 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 #define GIF_OK 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 #ifndef TRUE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 #define TRUE 1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 #define FALSE 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 #ifndef NULL
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 #define NULL 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 #endif /* NULL */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 #define GIF_FILE_BUFFER_SIZE 16384 /* Files uses bigger buffers than usual. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 typedef int GifBooleanType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 typedef unsigned char GifPixelType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 typedef unsigned char * GifRowType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 typedef unsigned char GifByteType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #define GIF_MESSAGE(Msg) fprintf(stderr, "\n%s: %s\n", PROGRAM_NAME, Msg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #define GIF_EXIT(Msg) { GIF_MESSAGE(Msg); exit(-3); }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 #ifdef SYSV
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #define VoidPtr char *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 #define VoidPtr void *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 #endif /* SYSV */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 typedef struct GifColorType {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 GifByteType Red, Green, Blue;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 } GifColorType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 typedef struct ColorMapObject
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 int ColorCount;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 int BitsPerPixel;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 GifColorType *Colors; /* on malloc(3) heap */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 }
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ColorMapObject;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 typedef struct GifImageDesc {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 int Left, Top, Width, Height, /* Current image dimensions. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 Interlace; /* Sequential/Interlaced lines. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ColorMapObject *ColorMap; /* The local color map */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 } GifImageDesc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 typedef struct GifFileType {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 int SWidth, SHeight, /* Screen dimensions. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 SColorResolution, /* How many colors can we generate? */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 SBackGroundColor; /* I hope you understand this one... */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ColorMapObject *SColorMap; /* NULL if not exists. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 int ImageCount; /* Number of current image */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 GifImageDesc Image; /* Block describing current image */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 struct SavedImage *SavedImages; /* Use this to accumulate file state */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 VoidPtr Private; /* Don't mess with this! */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 } GifFileType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 typedef enum {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 UNDEFINED_RECORD_TYPE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 SCREEN_DESC_RECORD_TYPE,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 EXTENSION_RECORD_TYPE, /* Begin with '!' */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 TERMINATE_RECORD_TYPE /* Begin with ';' */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 } GifRecordType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 /* DumpScreen2Gif routine constants identify type of window/screen to dump. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 /* Note all values below 1000 are reserved for the IBMPC different display */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 /* devices (it has many!) and are compatible with the numbering TC2.0 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 /* (Turbo C 2.0 compiler for IBM PC) gives to these devices. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 typedef enum {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 GIF_DUMP_SGI_WINDOW = 1000,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 GIF_DUMP_X_WINDOW = 1001
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 } GifScreenDumpType;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 * O.K., here are the routines one can access in order to encode GIF file: *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 * (GIF_LIB file EGIF_LIB.C). *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 GifFileType *EGifOpenFileName(char *GifFileName, int GifTestExistance);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 GifFileType *EGifOpenFileHandle(int GifFileHandle);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 int EGifSpew(GifFileType *GifFile);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 void EGifSetGifVersion(char *Version);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 int EGifPutScreenDesc(GifFileType *GifFile,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 int GifWidth, int GifHeight, int GifColorRes, int GifBackGround,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ColorMapObject *GifColorMap);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 int EGifPutImageDesc(GifFileType *GifFile,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 int GifLeft, int GifTop, int Width, int GifHeight, int GifInterlace,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ColorMapObject *GifColorMap);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 int EGifPutPixel(GifFileType *GifFile, GifPixelType GifPixel);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 int EGifPutComment(GifFileType *GifFile, char *GifComment);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 int EGifPutExtension(GifFileType *GifFile, int GifExtCode, int GifExtLen,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 VoidPtr GifExtension);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 int EGifPutCode(GifFileType *GifFile, int GifCodeSize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 GifByteType *GifCodeBlock);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 int EGifPutCodeNext(GifFileType *GifFile, GifByteType *GifCodeBlock);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 int EGifCloseFile(GifFileType *GifFile);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 #define E_GIF_ERR_WRITE_FAILED 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 #define E_GIF_ERR_HAS_SCRN_DSCR 3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 #define E_GIF_ERR_HAS_IMAG_DSCR 4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 #define E_GIF_ERR_NO_COLOR_MAP 5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 #define E_GIF_ERR_DATA_TOO_BIG 6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 #define E_GIF_ERR_NOT_ENOUGH_MEM 7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 #define E_GIF_ERR_DISK_IS_FULL 8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 #define E_GIF_ERR_CLOSE_FAILED 9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 #define E_GIF_ERR_NOT_WRITEABLE 10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 * O.K., here are the routines one can access in order to decode GIF file: *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 * (GIF_LIB file DGIF_LIB.C). *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 GifFileType *DGifOpenFileName(const char *GifFileName);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 GifFileType *DGifOpenFileHandle(int GifFileHandle);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 int DGifSlurp(GifFileType *GifFile);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 int DGifGetScreenDesc(GifFileType *GifFile);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 int DGifGetImageDesc(GifFileType *GifFile);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 int DGifGetComment(GifFileType *GifFile, char *GifComment);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 GifByteType **GifExtension);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 int DGifGetCode(GifFileType *GifFile, int *GifCodeSize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 GifByteType **GifCodeBlock);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 int DGifCloseFile(GifFileType *GifFile);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 #define D_GIF_ERR_READ_FAILED 102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 #define D_GIF_ERR_NOT_GIF_FILE 103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 #define D_GIF_ERR_NO_SCRN_DSCR 104
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 #define D_GIF_ERR_NO_IMAG_DSCR 105
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 #define D_GIF_ERR_NO_COLOR_MAP 106
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 #define D_GIF_ERR_WRONG_RECORD 107
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 #define D_GIF_ERR_DATA_TOO_BIG 108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 #define D_GIF_ERR_NOT_ENOUGH_MEM 109
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 #define D_GIF_ERR_CLOSE_FAILED 110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 #define D_GIF_ERR_NOT_READABLE 111
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 #define D_GIF_ERR_IMAGE_DEFECT 112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 #define D_GIF_ERR_EOF_TOO_SOON 113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 * O.K., here are the routines from GIF_LIB file QUANTIZE.C. *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 int QuantizeBuffer(unsigned int Width, unsigned int Height, int *ColorMapSize,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 GifByteType *RedInput, GifByteType *GreenInput, GifByteType *BlueInput,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 GifByteType *OutputBuffer, GifColorType *OutputColorMap);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 * O.K., here are the routines from GIF_LIB file QPRINTF.C. *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 extern int GifQuietPrint;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 #ifdef USE_VARARGS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 extern void GifQprintf();
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 extern void GifQprintf(char *Format, ...);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 #endif /* USE_VARARGS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 * O.K., here are the routines from GIF_LIB file GIF_ERR.C. *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 #ifdef emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 extern CONST char *EmacsPrintGifError(void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 #else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 extern void PrintGifError(void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 extern int GifLastError(void);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 * O.K., here are the routines from GIF_LIB file DEV2GIF.C. *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 extern int DumpScreen2Gif(char *FileName,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 int ReqGraphDriver,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 int ReqGraphMode1,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 int ReqGraphMode2,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 int ReqGraphMode3);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 /*****************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 * Everything below this point is new after version 1.2, supporting `slurp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 * mode' for doing I/O in two big belts with all the image-bashing in core.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 *****************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 * Color Map handling from ALLOCGIF.C *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 extern ColorMapObject *MakeMapObject(int ColorCount, GifColorType *ColorMap);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 extern void FreeMapObject(ColorMapObject *Objet);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 extern ColorMapObject *UnionColorMap(ColorMapObject *ColorIn1,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ColorMapObject *ColorIn2,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 GifPixelType ColorTransIn2[]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 extern int BitSize(int n);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 * Support for the in-core structures allocation (slurp mode). *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 /* This is the in-core version of an extension record */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 typedef struct {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 int ByteCount;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 GifByteType *Bytes; /* on malloc(3) heap */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 } ExtensionBlock;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 /* This holds an image header, its unpacked raster bits, and extensions */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 typedef struct SavedImage {
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 GifImageDesc ImageDesc;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 GifPixelType *RasterBits; /* on malloc(3) heap */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 int Function;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 int ExtensionBlockCount;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ExtensionBlock *ExtensionBlocks; /* on malloc(3) heap */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 } SavedImage;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 extern void ApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 extern void MakeExtension(SavedImage *New, int Function);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 extern int AddExtensionBlock(SavedImage *New, int Len, char ExtData[]);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 extern void FreeExtension(SavedImage *Image);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 extern SavedImage *MakeSavedImage(GifFileType *GifFile, SavedImage *CopyFrom);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 extern void FreeSavedImages(GifFileType *GifFile);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 /******************************************************************************
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 * The library's internal utility font *
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ******************************************************************************/
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 #define GIF_FONT_WIDTH 8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 #define GIF_FONT_HEIGHT 8
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 extern unsigned char AsciiTable[][GIF_FONT_WIDTH];
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 extern void DrawText(SavedImage *Image,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 const int x, const int y,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 const char *legend,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 const int color);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 extern void DrawBox(SavedImage *Image,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 const int x, const int y,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 const int w, const int d,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 const int color);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 void DrawRectangle(SavedImage *Image,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 const int x, const int y,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 const int w, const int d,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 const int color);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 extern void DrawBoxedText(SavedImage *Image,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 const int x, const int y,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 const char *legend,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 const int border,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 const int bg,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 const int fg);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 #endif /* GIF_LIB_H */