diff options
Diffstat (limited to 'gif_lib.h')
-rw-r--r-- | gif_lib.h | 41 |
1 files changed, 36 insertions, 5 deletions
@@ -12,12 +12,13 @@ extern "C" { #endif /* __cplusplus */ #define GIFLIB_MAJOR 5 -#define GIFLIB_MINOR 0 +#define GIFLIB_MINOR 1 #define GIFLIB_RELEASE 4 #define GIF_ERROR 0 #define GIF_OK 1 +#include <stddef.h> #include <stdbool.h> #define GIF_STAMP "GIFVER" /* First chars in file - GIF stamp. */ @@ -127,9 +128,10 @@ GifFileType *EGifOpenFileName(const char *GifFileName, GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error); GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error); int EGifSpew(GifFileType * GifFile); -char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ -int EGifCloseFile(GifFileType * GifFile); +const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */ +int EGifCloseFile(GifFileType *GifFile, int *ErrorCode); +#define E_GIF_SUCCEEDED 0 #define E_GIF_ERR_OPEN_FAILED 1 /* And EGif possible errors. */ #define E_GIF_ERR_WRITE_FAILED 2 #define E_GIF_ERR_HAS_SCRN_DSCR 3 @@ -178,8 +180,9 @@ GifFileType *DGifOpenFileName(const char *GifFileName, int *Error); GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error); int DGifSlurp(GifFileType * GifFile); GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error); /* new one (TVT) */ -int DGifCloseFile(GifFileType * GifFile); + int DGifCloseFile(GifFileType * GifFile, int *ErrorCode); +#define D_GIF_SUCCEEDED 0 #define D_GIF_ERR_OPEN_FAILED 101 /* And DGif possible errors. */ #define D_GIF_ERR_READ_FAILED 102 #define D_GIF_ERR_NOT_GIF_FILE 103 @@ -222,7 +225,7 @@ int GifQuantizeBuffer(unsigned int Width, unsigned int Height, /****************************************************************************** Error handling and reporting. ******************************************************************************/ -extern char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ +extern const char *GifErrorString(int ErrorCode); /* new in 2012 - ESR */ /***************************************************************************** Everything below this point is new after version 1.2, supporting `slurp @@ -241,6 +244,9 @@ extern ColorMapObject *GifUnionColorMap(const ColorMapObject *ColorIn1, GifPixelType ColorTransIn2[]); extern int GifBitSize(int n); +extern void * +reallocarray(void *optr, size_t nmemb, size_t size); + /****************************************************************************** Support for the in-core structures allocation (slurp mode). ******************************************************************************/ @@ -273,6 +279,31 @@ int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, GifFileType *GifFile, int ImageIndex); +/****************************************************************************** + The library's internal utility font +******************************************************************************/ + +#define GIF_FONT_WIDTH 8 +#define GIF_FONT_HEIGHT 8 +extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH]; + +extern void GifDrawText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, const int color); + +extern void GifDrawBox(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +extern void GifDrawRectangle(SavedImage *Image, + const int x, const int y, + const int w, const int d, const int color); + +extern void GifDrawBoxedText8x8(SavedImage *Image, + const int x, const int y, + const char *legend, + const int border, const int bg, const int fg); + #ifdef __cplusplus } #endif /* __cplusplus */ |