< prev index next >

src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h

Print this page




   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  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  * In order to make life a little bit easier when using the GIF file format,
  27  * this library was written, and which does all the dirty work...
  28  *
  29  *                                        Written by Gershon Elber,  Jun. 1989
  30  *                                        Hacks by Eric S. Raymond,  Sep. 1992
  31  ******************************************************************************
  32  * History:
  33  * 14 Jun 89 - Version 1.0 by Gershon Elber.
  34  *  3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names)
  35  * 15 Sep 90 - Version 2.0 by Eric S. Raymond (Changes to suoport GIF slurp)
  36  * 26 Jun 96 - Version 3.0 by Eric S. Raymond (Full GIF89 support)
  37  * 17 Dec 98 - Version 4.0 by Toshio Kuratomi (Fix extension writing code)
  38  *****************************************************************************/
  39 
  40 /* all encoding functionality stripped */


  41 
  42 #ifndef _GIF_LIB_H_
  43 #define _GIF_LIB_H_ 1
  44 
  45 #ifdef __cplusplus
  46 extern "C" {
  47 #endif /* __cplusplus */
  48 
  49 #define GIF_LIB_VERSION " Version 4.1, "


  50 
  51 #define GIF_ERROR   0
  52 #define GIF_OK      1
  53 
  54 #ifndef TRUE
  55 #define TRUE        1
  56 #endif /* TRUE */
  57 #ifndef FALSE
  58 #define FALSE       0
  59 #endif /* FALSE */
  60 
  61 #ifndef NULL
  62 #define NULL        0
  63 #endif /* NULL */
  64 
  65 #define GIF_STAMP "GIFVER"          /* First chars in file - GIF stamp.  */
  66 #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
  67 #define GIF_VERSION_POS 3           /* Version first character in stamp. */
  68 #define GIF87_STAMP "GIF87a"        /* First chars in file - GIF stamp.  */
  69 #define GIF89_STAMP "GIF89a"        /* First chars in file - GIF stamp.  */
  70 
  71 #define GIF_FILE_BUFFER_SIZE 16384  /* Files uses bigger buffers than usual. */
  72 
  73 typedef int GifBooleanType;
  74 typedef unsigned char GifPixelType;
  75 typedef unsigned char *GifRowType;
  76 typedef unsigned char GifByteType;
  77 
  78 #define GIF_MESSAGE(Msg) fprintf(stderr, "\n%s: %s\n", PROGRAM_NAME, Msg)
  79 #define GIF_EXIT(Msg)    { GIF_MESSAGE(Msg); exit(-3); }
  80 
  81 #ifdef SYSV
  82 #define VoidPtr char *
  83 #else
  84 #define VoidPtr void *
  85 #endif /* SYSV */
  86 
  87 typedef struct GifColorType {
  88     GifByteType Red, Green, Blue;
  89 } GifColorType;
  90 
  91 typedef struct ColorMapObject {
  92     int ColorCount;
  93     int BitsPerPixel;

  94     GifColorType *Colors;    /* on malloc(3) heap */
  95 } ColorMapObject;
  96 
  97 typedef struct GifImageDesc {
  98     int Left, Top, Width, Height,   /* Current image dimensions. */
  99       Interlace;                    /* Sequential/Interlaced lines. */
 100     ColorMapObject *ColorMap;       /* The local color map */
 101 } GifImageDesc;
 102 


















 103 typedef struct GifFileType {
 104     int SWidth, SHeight,        /* Screen dimensions. */
 105       SColorResolution,         /* How many colors can we generate? */
 106       SBackGroundColor;         /* I hope you understand this one... */
 107     ColorMapObject *SColorMap;  /* NULL if not exists. */
 108     int ImageCount;             /* Number of current image */
 109     GifImageDesc Image;         /* Block describing current image */
 110     struct SavedImage *SavedImages; /* Use this to accumulate file state */
 111     VoidPtr UserData;           /* hook to attach user data (TVT) */
 112     VoidPtr Private;            /* Don't mess with this! */




 113 } GifFileType;
 114 


 115 typedef enum {
 116     UNDEFINED_RECORD_TYPE,
 117     SCREEN_DESC_RECORD_TYPE,
 118     IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */
 119     EXTENSION_RECORD_TYPE,  /* Begin with '!' */
 120     TERMINATE_RECORD_TYPE   /* Begin with ';' */
 121 } GifRecordType;
 122 
 123 /* DumpScreen2Gif routine constants identify type of window/screen to dump.
 124  * Note all values below 1000 are reserved for the IBMPC different display
 125  * devices (it has many!) and are compatible with the numbering TC2.0
 126  * (Turbo C 2.0 compiler for IBM PC) gives to these devices.
 127  */
 128 typedef enum {
 129     GIF_DUMP_SGI_WINDOW = 1000,
 130     GIF_DUMP_X_WINDOW = 1001
 131 } GifScreenDumpType;
 132 
 133 /* func type to read gif data from arbitrary sources (TVT) */
 134 typedef int (*InputFunc) (GifFileType *, GifByteType *, int);
 135 
 136 /* func type to write gif data ro arbitrary targets.
 137  * Returns count of bytes written. (MRB)
 138  */
 139 typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int);
 140 
 141 /******************************************************************************
 142  *  GIF89 extension function codes
 143 ******************************************************************************/
 144 
 145 #define COMMENT_EXT_FUNC_CODE     0xfe    /* comment */
 146 #define GRAPHICS_EXT_FUNC_CODE    0xf9    /* graphics control */
 147 #define PLAINTEXT_EXT_FUNC_CODE   0x01    /* plaintext */
 148 #define APPLICATION_EXT_FUNC_CODE 0xff    /* application block */







 149 
 150 /******************************************************************************
 151  * O.K., here are the routines one can access in order to decode GIF file:
 152  * (GIF_LIB file DGIF_LIB.C).
 153  *****************************************************************************/
 154 
 155 GifFileType *DGifOpenFileName(const char *GifFileName);
 156 GifFileType *DGifOpenFileHandle(int GifFileHandle);
 157 GifFileType *DGifOpen(void *userPtr, InputFunc readFunc);    /* new one
 158                                                              * (TVT) */



















































 159 int DGifSlurp(GifFileType * GifFile);
 160 int DGifGetScreenDesc(GifFileType * GifFile);
 161 int DGifGetRecordType(GifFileType * GifFile, GifRecordType * GifType);
 162 int DGifGetImageDesc(GifFileType * GifFile);
 163 int DGifGetLine(GifFileType * GifFile, GifPixelType * GifLine, int GifLineLen);
 164 int DGifGetPixel(GifFileType * GifFile, GifPixelType GifPixel);
 165 int DGifGetComment(GifFileType * GifFile, char *GifComment);
 166 int DGifGetExtension(GifFileType * GifFile, int *GifExtCode,
 167                      GifByteType ** GifExtension);
 168 int DGifGetExtensionNext(GifFileType * GifFile, GifByteType ** GifExtension);
 169 int DGifGetCode(GifFileType * GifFile, int *GifCodeSize,
 170                 GifByteType ** GifCodeBlock);
 171 int DGifGetCodeNext(GifFileType * GifFile, GifByteType ** GifCodeBlock);
 172 int DGifGetLZCodes(GifFileType * GifFile, int *GifCode);
 173 int DGifCloseFile(GifFileType * GifFile);
 174 

 175 #define D_GIF_ERR_OPEN_FAILED    101    /* And DGif possible errors. */
 176 #define D_GIF_ERR_READ_FAILED    102
 177 #define D_GIF_ERR_NOT_GIF_FILE   103
 178 #define D_GIF_ERR_NO_SCRN_DSCR   104
 179 #define D_GIF_ERR_NO_IMAG_DSCR   105
 180 #define D_GIF_ERR_NO_COLOR_MAP   106
 181 #define D_GIF_ERR_WRONG_RECORD   107
 182 #define D_GIF_ERR_DATA_TOO_BIG   108
 183 #define D_GIF_ERR_NOT_ENOUGH_MEM 109
 184 #define D_GIF_ERR_CLOSE_FAILED   110
 185 #define D_GIF_ERR_NOT_READABLE   111
 186 #define D_GIF_ERR_IMAGE_DEFECT   112
 187 #define D_GIF_ERR_EOF_TOO_SOON   113
 188 















 189 
 190 /******************************************************************************
 191  * O.K., here are the routines from GIF_LIB file GIF_ERR.C.
 192 ******************************************************************************/
 193 extern void PrintGifError(void);
 194 extern int GifLastError(void);



 195 
 196 /******************************************************************************
 197  * O.K., here are the routines from GIF_LIB file DEV2GIF.C.
 198 ******************************************************************************/
 199 extern int DumpScreen2Gif(const char *FileName,
 200                           int ReqGraphDriver,
 201                           long ReqGraphMode1,
 202                           long ReqGraphMode2,
 203                           long ReqGraphMode3);
 204 
 205 /*****************************************************************************
 206  *
 207  * Everything below this point is new after version 1.2, supporting `slurp
 208  * mode' for doing I/O in two big belts with all the image-bashing in core.
 209  *
 210  *****************************************************************************/
 211 
 212 /******************************************************************************
 213  * Color Map handling from ALLOCGIF.C
 214  *****************************************************************************/
 215 
 216 extern ColorMapObject *MakeMapObject(int ColorCount,
 217                                      const GifColorType * ColorMap);
 218 extern void FreeMapObject(ColorMapObject * Object);
 219 extern int BitSize(int n);



 220 
 221 /******************************************************************************
 222  * Support for the in-core structures allocation (slurp mode).
 223  *****************************************************************************/
 224 
 225 /* This is the in-core version of an extension record */
 226 typedef struct {
 227     int ByteCount;
 228     char *Bytes;    /* on malloc(3) heap */
 229     int Function;   /* Holds the type of the Extension block. */
 230 } ExtensionBlock;




 231 
 232 /* This holds an image header, its unpacked raster bits, and extensions */
 233 typedef struct SavedImage {
 234     GifImageDesc ImageDesc;
 235     unsigned char *RasterBits;  /* on malloc(3) heap */
 236     int Function;   /* DEPRECATED: Use ExtensionBlocks[x].Function instead */
 237     int ExtensionBlockCount;
 238     ExtensionBlock *ExtensionBlocks;    /* on malloc(3) heap */
 239 } SavedImage;
 240 
 241 extern void MakeExtension(SavedImage * New, int Function);
 242 extern int AddExtensionBlock(SavedImage * New, int Len,
 243                              unsigned char ExtData[]);
 244 extern void FreeExtension(SavedImage * Image);
 245 extern SavedImage *MakeSavedImage(GifFileType * GifFile,
 246                                   const SavedImage * CopyFrom);
 247 extern void FreeSavedImages(GifFileType * GifFile);





 248 
























 249 
 250 #ifdef __cplusplus
 251 }
 252 #endif /* __cplusplus */
 253 #endif /* _GIF_LIB_H */




   6  * published by the Free Software Foundation.  Oracle designates this
   7  * particular file as subject to the "Classpath" exception as provided
   8  * by Oracle in the LICENSE file that accompanied this code.
   9  *
  10  * This code is distributed in the hope that it will be useful, but WITHOUT
  11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  13  * version 2 for more details (a copy is included in the LICENSE file that
  14  * accompanied this code).
  15  *
  16  * You should have received a copy of the GNU General Public License version
  17  * 2 along with this work; if not, write to the Free Software Foundation,
  18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  19  *
  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;
  61 typedef unsigned char *GifRowType;
  62 typedef unsigned char GifByteType;
  63 typedef unsigned int GifPrefixType;
  64 typedef int GifWord;







  65 
  66 typedef struct GifColorType {
  67     GifByteType Red, Green, Blue;
  68 } GifColorType;
  69 
  70 typedef struct ColorMapObject {
  71     int ColorCount;
  72     int BitsPerPixel;
  73     bool SortFlag;
  74     GifColorType *Colors;    /* on malloc(3) heap */
  75 } ColorMapObject;
  76 
  77 typedef struct GifImageDesc {
  78     GifWord Left, Top, Width, Height;   /* Current image dimensions. */
  79     bool Interlace;                     /* Sequential/Interlaced lines. */
  80     ColorMapObject *ColorMap;           /* The local color map */
  81 } GifImageDesc;
  82 
  83 typedef struct ExtensionBlock {
  84     int ByteCount;
  85     GifByteType *Bytes; /* on malloc(3) heap */
  86     int Function;       /* The block function code */
  87 #define CONTINUE_EXT_FUNC_CODE    0x00    /* continuation subblock */
  88 #define COMMENT_EXT_FUNC_CODE     0xfe    /* comment */
  89 #define GRAPHICS_EXT_FUNC_CODE    0xf9    /* graphics control (GIF89) */
  90 #define PLAINTEXT_EXT_FUNC_CODE   0x01    /* plaintext */
  91 #define APPLICATION_EXT_FUNC_CODE 0xff    /* application block */
  92 } ExtensionBlock;
  93 
  94 typedef struct SavedImage {
  95     GifImageDesc ImageDesc;
  96     GifByteType *RasterBits;         /* on malloc(3) heap */
  97     int ExtensionBlockCount;         /* Count of extensions before image */    
  98     ExtensionBlock *ExtensionBlocks; /* Extensions before image */    
  99 } SavedImage;
 100 
 101 typedef struct GifFileType {
 102     GifWord SWidth, SHeight;         /* Size of virtual canvas */
 103     GifWord SColorResolution;        /* How many colors can we generate? */
 104     GifWord SBackGroundColor;        /* Background color for virtual canvas */
 105     GifByteType AspectByte;          /* Used to compute pixel aspect ratio */
 106     ColorMapObject *SColorMap;       /* Global colormap, NULL if nonexistent. */
 107     int ImageCount;                  /* Number of current image (both APIs) */
 108     GifImageDesc Image;              /* Current image (low-level API) */
 109     SavedImage *SavedImages;         /* Image sequence (high-level API) */
 110     int ExtensionBlockCount;         /* Count extensions past last image */
 111     ExtensionBlock *ExtensionBlocks; /* Extensions past last image */    
 112     int Error;                       /* Last error condition reported */
 113     void *UserData;                  /* hook to attach user data (TVT) */
 114     void *Private;                   /* Don't mess with this! */
 115 } GifFileType;
 116 
 117 #define GIF_ASPECT_RATIO(n)     ((n)+15.0/64.0)
 118 
 119 typedef enum {
 120     UNDEFINED_RECORD_TYPE,
 121     SCREEN_DESC_RECORD_TYPE,
 122     IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */
 123     EXTENSION_RECORD_TYPE,  /* Begin with '!' */
 124     TERMINATE_RECORD_TYPE   /* Begin with ';' */
 125 } GifRecordType;
 126 










 127 /* func type to read gif data from arbitrary sources (TVT) */
 128 typedef int (*InputFunc) (GifFileType *, GifByteType *, int);
 129 
 130 /* func type to write gif data to arbitrary targets.
 131  * Returns count of bytes written. (MRB)
 132  */
 133 typedef int (*OutputFunc) (GifFileType *, const GifByteType *, int);
 134 
 135 /******************************************************************************
 136  GIF89 structures
 137 ******************************************************************************/
 138 
 139 typedef struct GraphicsControlBlock {
 140     int DisposalMode;
 141 #define DISPOSAL_UNSPECIFIED      0       /* No disposal specified. */
 142 #define DISPOSE_DO_NOT            1       /* Leave image in place */
 143 #define DISPOSE_BACKGROUND        2       /* Set area too background color */
 144 #define DISPOSE_PREVIOUS          3       /* Restore to previous content */
 145     bool UserInputFlag;      /* User confirmation required before disposal */
 146     int DelayTime;           /* pre-display delay in 0.01sec units */
 147     int TransparentColor;    /* Palette index for transparency, -1 if none */
 148 #define NO_TRANSPARENT_COLOR    -1
 149 } GraphicsControlBlock;
 150 
 151 /******************************************************************************
 152  GIF encoding routines
 153 ******************************************************************************/
 154 
 155 /* Main entry points */
 156 GifFileType *EGifOpenFileName(const char *GifFileName,
 157                               const bool GifTestExistence, int *Error);
 158 GifFileType *EGifOpenFileHandle(const int GifFileHandle, int *Error);
 159 GifFileType *EGifOpen(void *userPtr, OutputFunc writeFunc, int *Error);
 160 int EGifSpew(GifFileType * GifFile);
 161 const char *EGifGetGifVersion(GifFileType *GifFile); /* new in 5.x */
 162 int EGifCloseFile(GifFileType *GifFile, int *ErrorCode);
 163 
 164 #define E_GIF_SUCCEEDED          0
 165 #define E_GIF_ERR_OPEN_FAILED    1    /* And EGif possible errors. */
 166 #define E_GIF_ERR_WRITE_FAILED   2
 167 #define E_GIF_ERR_HAS_SCRN_DSCR  3
 168 #define E_GIF_ERR_HAS_IMAG_DSCR  4
 169 #define E_GIF_ERR_NO_COLOR_MAP   5
 170 #define E_GIF_ERR_DATA_TOO_BIG   6
 171 #define E_GIF_ERR_NOT_ENOUGH_MEM 7
 172 #define E_GIF_ERR_DISK_IS_FULL   8
 173 #define E_GIF_ERR_CLOSE_FAILED   9
 174 #define E_GIF_ERR_NOT_WRITEABLE  10
 175 
 176 /* These are legacy.  You probably do not want to call them directly */
 177 int EGifPutScreenDesc(GifFileType *GifFile,
 178                       const int GifWidth, const int GifHeight, 
 179                       const int GifColorRes,
 180                       const int GifBackGround,
 181                       const ColorMapObject *GifColorMap);
 182 int EGifPutImageDesc(GifFileType *GifFile, 
 183                      const int GifLeft, const int GifTop,
 184                      const int GifWidth, const int GifHeight, 
 185                      const bool GifInterlace,
 186                      const ColorMapObject *GifColorMap);
 187 void EGifSetGifVersion(GifFileType *GifFile, const bool gif89);
 188 int EGifPutLine(GifFileType *GifFile, GifPixelType *GifLine,
 189                 int GifLineLen);
 190 int EGifPutPixel(GifFileType *GifFile, const GifPixelType GifPixel);
 191 int EGifPutComment(GifFileType *GifFile, const char *GifComment);
 192 int EGifPutExtensionLeader(GifFileType *GifFile, const int GifExtCode);
 193 int EGifPutExtensionBlock(GifFileType *GifFile,
 194                          const int GifExtLen, const void *GifExtension);
 195 int EGifPutExtensionTrailer(GifFileType *GifFile);
 196 int EGifPutExtension(GifFileType *GifFile, const int GifExtCode, 
 197                      const int GifExtLen,
 198                      const void *GifExtension);
 199 int EGifPutCode(GifFileType *GifFile, int GifCodeSize,
 200                 const GifByteType *GifCodeBlock);
 201 int EGifPutCodeNext(GifFileType *GifFile,
 202                     const GifByteType *GifCodeBlock);
 203 
 204 /******************************************************************************
 205  GIF decoding routines
 206 ******************************************************************************/
 207 
 208 /* Main entry points */
 209 GifFileType *DGifOpenFileName(const char *GifFileName, int *Error);
 210 GifFileType *DGifOpenFileHandle(int GifFileHandle, int *Error);
 211 int DGifSlurp(GifFileType * GifFile);
 212 GifFileType *DGifOpen(void *userPtr, InputFunc readFunc, int *Error);    /* new one (TVT) */
 213     int DGifCloseFile(GifFileType * GifFile, int *ErrorCode);












 214 
 215 #define D_GIF_SUCCEEDED          0
 216 #define D_GIF_ERR_OPEN_FAILED    101    /* And DGif possible errors. */
 217 #define D_GIF_ERR_READ_FAILED    102
 218 #define D_GIF_ERR_NOT_GIF_FILE   103
 219 #define D_GIF_ERR_NO_SCRN_DSCR   104
 220 #define D_GIF_ERR_NO_IMAG_DSCR   105
 221 #define D_GIF_ERR_NO_COLOR_MAP   106
 222 #define D_GIF_ERR_WRONG_RECORD   107
 223 #define D_GIF_ERR_DATA_TOO_BIG   108
 224 #define D_GIF_ERR_NOT_ENOUGH_MEM 109
 225 #define D_GIF_ERR_CLOSE_FAILED   110
 226 #define D_GIF_ERR_NOT_READABLE   111
 227 #define D_GIF_ERR_IMAGE_DEFECT   112
 228 #define D_GIF_ERR_EOF_TOO_SOON   113
 229 
 230 /* These are legacy.  You probably do not want to call them directly */
 231 int DGifGetScreenDesc(GifFileType *GifFile);
 232 int DGifGetRecordType(GifFileType *GifFile, GifRecordType *GifType);
 233 int DGifGetImageDesc(GifFileType *GifFile);
 234 int DGifGetLine(GifFileType *GifFile, GifPixelType *GifLine, int GifLineLen);
 235 int DGifGetPixel(GifFileType *GifFile, GifPixelType GifPixel);
 236 int DGifGetComment(GifFileType *GifFile, char *GifComment);
 237 int DGifGetExtension(GifFileType *GifFile, int *GifExtCode,
 238                      GifByteType **GifExtension);
 239 int DGifGetExtensionNext(GifFileType *GifFile, GifByteType **GifExtension);
 240 int DGifGetCode(GifFileType *GifFile, int *GifCodeSize,
 241                 GifByteType **GifCodeBlock);
 242 int DGifGetCodeNext(GifFileType *GifFile, GifByteType **GifCodeBlock);
 243 int DGifGetLZCodes(GifFileType *GifFile, int *GifCode);
 244 
 245 
 246 /******************************************************************************
 247  Color table quantization (deprecated)
 248 ******************************************************************************/
 249 int GifQuantizeBuffer(unsigned int Width, unsigned int Height,
 250                    int *ColorMapSize, GifByteType * RedInput,
 251                    GifByteType * GreenInput, GifByteType * BlueInput,
 252                    GifByteType * OutputBuffer,
 253                    GifColorType * OutputColorMap);
 254 
 255 /******************************************************************************
 256  Error handling and reporting.
 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,
 297                        const GifByteType *GifExtension,
 298                        GraphicsControlBlock *GCB);
 299 size_t EGifGCBToExtension(const GraphicsControlBlock *GCB,
 300                        GifByteType *GifExtension);
 301 
 302 int DGifSavedExtensionToGCB(GifFileType *GifFile, 
 303                             int ImageIndex, 
 304                             GraphicsControlBlock *GCB);
 305 int EGifGCBToSavedExtension(const GraphicsControlBlock *GCB, 
 306                             GifFileType *GifFile, 
 307                             int ImageIndex);
 308 
 309 /******************************************************************************
 310  The library's internal utility font                          
 311 ******************************************************************************/
 312 
 313 #define GIF_FONT_WIDTH  8
 314 #define GIF_FONT_HEIGHT 8
 315 extern const unsigned char GifAsciiTable8x8[][GIF_FONT_WIDTH];
 316 
 317 extern void GifDrawText8x8(SavedImage *Image,
 318                      const int x, const int y,
 319                      const char *legend, const int color);
 320 
 321 extern void GifDrawBox(SavedImage *Image,
 322                     const int x, const int y,
 323                     const int w, const int d, const int color);
 324 
 325 extern void GifDrawRectangle(SavedImage *Image,
 326                    const int x, const int y,
 327                    const int w, const int d, const int color);
 328 
 329 extern void GifDrawBoxedText8x8(SavedImage *Image,
 330                           const int x, const int y,
 331                           const char *legend,
 332                           const int border, const int bg, const int fg);
 333 
 334 #ifdef __cplusplus
 335 }
 336 #endif /* __cplusplus */
 337 #endif /* _GIF_LIB_H */
 338 
 339 /* end */
< prev index next >