~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/windowscodecs/ungif.h

Version: ~ [ wine-1.5.30 ] ~ [ wine-1.5.29 ] ~ [ wine-1.5.28 ] ~ [ wine-1.5.27 ] ~ [ wine-1.5.26 ] ~ [ wine-1.5.25 ] ~ [ wine-1.5.24 ] ~ [ wine-1.5.23 ] ~ [ wine-1.5.22 ] ~ [ wine-1.5.21 ] ~ [ wine-1.5.20 ] ~ [ wine-1.5.19 ] ~ [ wine-1.5.18 ] ~ [ wine-1.5.17 ] ~ [ wine-1.5.16 ] ~ [ wine-1.5.15 ] ~ [ wine-1.5.14 ] ~ [ wine-1.5.13 ] ~ [ wine-1.5.12 ] ~ [ wine-1.5.11 ] ~ [ wine-1.5.10 ] ~ [ wine-1.5.9 ] ~ [ wine-1.5.8 ] ~ [ wine-1.5.7 ] ~ [ wine-1.4.1 ] ~ [ wine-1.5.6 ] ~ [ wine-1.5.5 ] ~ [ wine-1.5.4 ] ~ [ wine-1.5.3 ] ~ [ wine-1.5.2 ] ~ [ wine-1.5.1 ] ~ [ wine-1.5.0 ] ~ [ wine-1.4 ] ~ [ wine-1.4-rc6 ] ~ [ wine-1.4-rc5 ] ~ [ wine-1.4-rc4 ] ~ [ wine-1.4-rc3 ] ~ [ wine-1.4-rc2 ] ~ [ wine-1.4-rc1 ] ~ [ wine-1.3.37 ] ~ [ wine-1.3.36 ] ~ [ wine-1.3.35 ] ~ [ wine-1.3.34 ] ~ [ wine-1.3.33 ] ~ [ wine-1.3.32 ] ~ [ wine-1.3.31 ] ~ [ wine-1.3.30 ] ~ [ wine-1.3.29 ] ~ [ wine-1.3.28 ] ~ [ wine-1.3.27 ] ~ [ wine-1.3.26 ] ~ [ wine-1.3.25 ] ~ [ wine-1.3.24 ] ~ [ wine-1.3.23 ] ~ [ wine-1.3.22 ] ~ [ wine-1.3.21 ] ~ [ wine-1.3.20 ] ~ [ wine-1.3.19 ] ~ [ wine-1.3.18 ] ~ [ wine-1.2.3 ] ~ [ wine-1.3.17 ] ~ [ wine-1.3.16 ] ~ [ wine-1.3.15 ] ~ [ wine-1.3.14 ] ~ [ wine-1.3.13 ] ~ [ wine-1.3.12 ] ~ [ wine-1.3.11 ] ~ [ wine-1.3.10 ] ~ [ wine-1.3.9 ] ~ [ wine-1.2.2 ] ~ [ wine-1.3.8 ] ~ [ wine-1.3.7 ] ~ [ wine-1.3.6 ] ~ [ wine-1.3.5 ] ~ [ wine-1.2.1 ] ~ [ wine-1.3.4 ] ~ [ wine-1.3.3 ] ~ [ wine-1.3.2 ] ~ [ wine-1.3.1 ] ~ [ wine-1.3.0 ] ~ [ wine-1.2 ] ~ [ wine-1.2-rc7 ] ~ [ wine-1.2-rc6 ] ~ [ wine-1.2-rc5 ] ~ [ wine-1.2-rc4 ] ~ [ wine-1.2-rc3 ] ~ [ wine-1.2-rc2 ] ~ [ wine-1.2-rc1 ] ~ [ wine-1.1.44 ] ~ [ wine-1.1.43 ] ~ [ wine-1.1.42 ] ~ [ wine-1.1.41 ] ~ [ wine-1.1.40 ] ~ [ wine-1.1.39 ] ~ [ wine-1.1.38 ] ~ [ wine-1.1.37 ] ~ [ wine-1.1.36 ] ~ [ wine-1.1.35 ] ~ [ wine-1.1.34 ] ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  1 /*
  2  * Gif extracting routines - derived from libungif
  3  *
  4  * Portions Copyright 2006 Mike McCormack
  5  *
  6  * This library is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU Lesser General Public
  8  * License as published by the Free Software Foundation; either
  9  * version 2.1 of the License, or (at your option) any later version.
 10  *
 11  * This library is distributed in the hope that it will be useful,
 12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 14  * Lesser General Public License for more details.
 15  *
 16  * You should have received a copy of the GNU Lesser General Public
 17  * License along with this library; if not, write to the Free Software
 18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 19  */
 20 
 21 /*
 22  * Original copyright notice:
 23  *
 24  * The GIFLIB distribution is Copyright (c) 1997  Eric S. Raymond
 25  *
 26  * Permission is hereby granted, free of charge, to any person obtaining a copy
 27  * of this software and associated documentation files (the "Software"), to deal
 28  * in the Software without restriction, including without limitation the rights
 29  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 30  * copies of the Software, and to permit persons to whom the Software is
 31  * furnished to do so, subject to the following conditions:
 32  *
 33  * The above copyright notice and this permission notice shall be included in
 34  * all copies or substantial portions of the Software.
 35  */
 36 
 37 /******************************************************************************
 38  * In order to make life a little bit easier when using the GIF file format,
 39  * this library was written, and which does all the dirty work...
 40  *
 41  *                                        Written by Gershon Elber,  Jun. 1989
 42  *                                        Hacks by Eric S. Raymond,  Sep. 1992
 43  ******************************************************************************
 44  * History:
 45  * 14 Jun 89 - Version 1.0 by Gershon Elber.
 46  *  3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names)
 47  * 15 Sep 90 - Version 2.0 by Eric S. Raymond (Changes to support GIF slurp)
 48  * 26 Jun 96 - Version 3.0 by Eric S. Raymond (Full GIF89 support)
 49  * 17 Dec 98 - Version 4.0 by Toshio Kuratomi (Fix extension writing code)
 50  *****************************************************************************/
 51 
 52 #ifndef _UNGIF_H_
 53 #define _UNGIF_H_ 1
 54 
 55 #define GIF_ERROR   0
 56 #define GIF_OK      1
 57 
 58 #ifndef TRUE
 59 #define TRUE        1
 60 #endif /* TRUE */
 61 #ifndef FALSE
 62 #define FALSE       0
 63 #endif /* FALSE */
 64 
 65 #ifndef NULL
 66 #define NULL        0
 67 #endif /* NULL */
 68 
 69 #define GIF_STAMP "GIFVER"          /* First chars in file - GIF stamp.  */
 70 #define GIF_STAMP_LEN sizeof(GIF_STAMP) - 1
 71 #define GIF_VERSION_POS 3           /* Version first character in stamp. */
 72 #define GIF87_STAMP "GIF87a"        /* First chars in file - GIF stamp.  */
 73 #define GIF89_STAMP "GIF89a"        /* First chars in file - GIF stamp.  */
 74 
 75 #define GIF_FILE_BUFFER_SIZE 16384  /* Files uses bigger buffers than usual. */
 76 
 77 typedef int GifBooleanType;
 78 typedef unsigned char GifPixelType;
 79 typedef unsigned char *GifRowType;
 80 typedef unsigned char GifByteType;
 81 typedef unsigned int GifPrefixType;
 82 typedef int GifWord;
 83 
 84 typedef struct GifColorType {
 85     GifByteType Red, Green, Blue;
 86 } GifColorType;
 87 
 88 typedef struct ColorMapObject {
 89     int ColorCount;
 90     int BitsPerPixel;
 91     GifColorType *Colors;
 92 } ColorMapObject;
 93 
 94 typedef struct GifImageDesc {
 95     GifWord Left, Top, Width, Height,   /* Current image dimensions. */
 96       Interlace;                    /* Sequential/Interlaced lines. */
 97     ColorMapObject *ColorMap;       /* The local color map */
 98 } GifImageDesc;
 99 
100 typedef struct GifFileType {
101     GifWord SWidth, SHeight,        /* Screen dimensions. */
102       SColorResolution,         /* How many colors can we generate? */
103       SBackGroundColor,         /* I hope you understand this one... */
104       SAspectRatio;             /* Pixel aspect ratio, in 1/64 units, starting at 1:4. */
105     ColorMapObject *SColorMap;  /* NULL if not exists. */
106     int ImageCount;             /* Number of current image */
107     GifImageDesc Image;         /* Block describing current image */
108     struct SavedImage *SavedImages; /* Use this to accumulate file state */
109     void *UserData;             /* hook to attach user data (TVT) */
110     void *Private;              /* Don't mess with this! */
111 } GifFileType;
112 
113 typedef enum {
114     UNDEFINED_RECORD_TYPE,
115     SCREEN_DESC_RECORD_TYPE,
116     IMAGE_DESC_RECORD_TYPE, /* Begin with ',' */
117     EXTENSION_RECORD_TYPE,  /* Begin with '!' */
118     TERMINATE_RECORD_TYPE   /* Begin with ';' */
119 } GifRecordType;
120 
121 /* func type to read gif data from arbitrary sources (TVT) */
122 typedef int (*InputFunc) (GifFileType *, GifByteType *, int);
123 
124 /*  GIF89 extension function codes */
125 
126 #define COMMENT_EXT_FUNC_CODE     0xfe    /* comment */
127 #define GRAPHICS_EXT_FUNC_CODE    0xf9    /* graphics control */
128 #define PLAINTEXT_EXT_FUNC_CODE   0x01    /* plaintext */
129 #define APPLICATION_EXT_FUNC_CODE 0xff    /* application block */
130 
131 /* public interface to ungif.c */
132 int DGifSlurp(GifFileType * GifFile);
133 GifFileType *DGifOpen(void *userPtr, InputFunc readFunc);
134 int DGifCloseFile(GifFileType * GifFile);
135 
136 #define D_GIF_ERR_OPEN_FAILED    101    /* And DGif possible errors. */
137 #define D_GIF_ERR_READ_FAILED    102
138 #define D_GIF_ERR_NOT_GIF_FILE   103
139 #define D_GIF_ERR_NO_SCRN_DSCR   104
140 #define D_GIF_ERR_NO_IMAG_DSCR   105
141 #define D_GIF_ERR_NO_COLOR_MAP   106
142 #define D_GIF_ERR_WRONG_RECORD   107
143 #define D_GIF_ERR_DATA_TOO_BIG   108
144 #define D_GIF_ERR_NOT_ENOUGH_MEM 109
145 #define D_GIF_ERR_CLOSE_FAILED   110
146 #define D_GIF_ERR_NOT_READABLE   111
147 #define D_GIF_ERR_IMAGE_DEFECT   112
148 #define D_GIF_ERR_EOF_TOO_SOON   113
149 
150 /******************************************************************************
151  * Support for the in-core structures allocation (slurp mode).
152  *****************************************************************************/
153 
154 /* This is the in-core version of an extension record */
155 typedef struct {
156     int ByteCount;
157     char *Bytes;
158     int Function;   /* Holds the type of the Extension block. */
159 } ExtensionBlock;
160 
161 /* This holds an image header, its unpacked raster bits, and extensions */
162 typedef struct SavedImage {
163     GifImageDesc ImageDesc;
164     unsigned char *RasterBits;
165     int Function;   /* DEPRECATED: Use ExtensionBlocks[x].Function instead */
166     int ExtensionBlockCount;
167     ExtensionBlock *ExtensionBlocks;
168 } SavedImage;
169 
170 #endif /* _UNGIF_H_ */
171 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.