20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
24
25 /******************************************************************************
26
27 gif_lib.h - service library for decoding and encoding GIF images
28
29 *****************************************************************************/
30
31 #ifndef _GIF_LIB_H_
32 #define _GIF_LIB_H_ 1
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37
38 #define GIFLIB_MAJOR 5
39 #define GIFLIB_MINOR 1
40 #define GIFLIB_RELEASE 1
41
42 #define GIF_ERROR 0
43 #define GIF_OK 1
44
45 #include <stddef.h>
46
47 #ifdef bool
48 #undef bool
49 #endif
50 typedef int bool;
51 #define false 0
52 #define true 1
53
54 #define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */
55 #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
56 #define GIF_VERSION_POS 3 /* Version first character in stamp. */
57 #define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */
58 #define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */
59
60 typedef unsigned char GifPixelType;
257 ******************************************************************************/
258 extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
259
260 /*****************************************************************************
261 Everything below this point is new after version 1.2, supporting `slurp
262 mode' for doing I/O in two big belts with all the image-bashing in core.
263 ******************************************************************************/
264
265 /******************************************************************************
266 Color map handling from gif_alloc.c
267 ******************************************************************************/
268
269 extern ColorMapObject *GifMakeMapObject(int ColorCount,
270 const GifColorType *ColorMap);
271 extern void GifFreeMapObject(ColorMapObject *Object);
272 extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1,
273 const ColorMapObject *ColorIn2,
274 GifPixelType ColorTransIn2[]);
275 extern int GifBitSize(int n);
276
277 /******************************************************************************
278 Support for the in-core structures allocation (slurp mode).
279 ******************************************************************************/
280
281 extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
282 extern int GifAddExtensionBlock(int *ExtensionBlock_Count,
283 ExtensionBlock **ExtensionBlocks,
284 int Function,
285 unsigned int Len, unsigned char ExtData[]);
286 extern void GifFreeExtensions(int *ExtensionBlock_Count,
287 ExtensionBlock **ExtensionBlocks);
288 extern SavedImage *GifMakeSavedImage(GifFileType *GifFile,
289 const SavedImage *CopyFrom);
290 extern void GifFreeSavedImages(GifFileType *GifFile);
291
292 /******************************************************************************
293 5.x functions for GIF89 graphics control blocks
294 ******************************************************************************/
295
296 int DGifExtensionToGCB(const size_t GifExtensionLength,
|
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 */
24
25 /******************************************************************************
26
27 gif_lib.h - service library for decoding and encoding GIF images
28
29 *****************************************************************************/
30
31 #ifndef _GIF_LIB_H_
32 #define _GIF_LIB_H_ 1
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37
38 #define GIFLIB_MAJOR 5
39 #define GIFLIB_MINOR 1
40 #define GIFLIB_RELEASE 4
41
42 #define GIF_ERROR 0
43 #define GIF_OK 1
44
45 #include <stddef.h>
46
47 #ifdef bool
48 #undef bool
49 #endif
50 typedef int bool;
51 #define false 0
52 #define true 1
53
54 #define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */
55 #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
56 #define GIF_VERSION_POS 3 /* Version first character in stamp. */
57 #define GIF87_STAMP "GIF87a" /* First chars in file - GIF stamp. */
58 #define GIF89_STAMP "GIF89a" /* First chars in file - GIF stamp. */
59
60 typedef unsigned char GifPixelType;
257 ******************************************************************************/
258 extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */
259
260 /*****************************************************************************
261 Everything below this point is new after version 1.2, supporting `slurp
262 mode' for doing I/O in two big belts with all the image-bashing in core.
263 ******************************************************************************/
264
265 /******************************************************************************
266 Color map handling from gif_alloc.c
267 ******************************************************************************/
268
269 extern ColorMapObject *GifMakeMapObject(int ColorCount,
270 const GifColorType *ColorMap);
271 extern void GifFreeMapObject(ColorMapObject *Object);
272 extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1,
273 const ColorMapObject *ColorIn2,
274 GifPixelType ColorTransIn2[]);
275 extern int GifBitSize(int n);
276
277 extern void * reallocarray(void *optr, size_t nmemb, size_t size);
278
279
280 /******************************************************************************
281 Support for the in-core structures allocation (slurp mode).
282 ******************************************************************************/
283
284 extern void GifApplyTranslation(SavedImage *Image, GifPixelType Translation[]);
285 extern int GifAddExtensionBlock(int *ExtensionBlock_Count,
286 ExtensionBlock **ExtensionBlocks,
287 int Function,
288 unsigned int Len, unsigned char ExtData[]);
289 extern void GifFreeExtensions(int *ExtensionBlock_Count,
290 ExtensionBlock **ExtensionBlocks);
291 extern SavedImage *GifMakeSavedImage(GifFileType *GifFile,
292 const SavedImage *CopyFrom);
293 extern void GifFreeSavedImages(GifFileType *GifFile);
294
295 /******************************************************************************
296 5.x functions for GIF89 graphics control blocks
297 ******************************************************************************/
298
299 int DGifExtensionToGCB(const size_t GifExtensionLength,
|