|
LibGd 2.4.0-dev
GD Graphics library
|
GIF image and animation reading and writing support. More...

Data Structures | |
| struct | gdGifInfo |
| Basic information read from a GIF stream. More... | |
| struct | gdGifFrameInfo |
| Per-frame information read from a GIF animation. More... | |
GIF animation disposal constants | |
| enum | { gdDisposalUnknown , gdDisposalNone , gdDisposalRestoreBackground , gdDisposalRestorePrevious } |
| GIF frame disposal methods. More... | |
| #define | GD_GIF_DISPOSAL_UNKNOWN gdDisposalUnknown |
| #define | GD_GIF_DISPOSAL_NONE gdDisposalNone |
| #define | GD_GIF_DISPOSAL_RESTORE_BACKGROUND gdDisposalRestoreBackground |
| #define | GD_GIF_DISPOSAL_RESTORE_PREVIOUS gdDisposalRestorePrevious |
Animated GIF reading | |
| typedef struct gdGifReadStruct * | gdGifReadPtr |
| Opaque animated GIF reader handle. | |
| int | gdGifIsAnimated (FILE *fd) |
| Test whether a seekable GIF stdio file contains more than one frame. | |
| int | gdGifIsAnimatedCtx (gdIOCtxPtr in) |
| Test whether a seekable GIF gdIOCtx contains more than one frame. | |
| int | gdGifIsAnimatedPtr (int size, void *data) |
| Test whether a GIF memory buffer contains more than one frame. | |
| gdGifReadPtr | gdGifReadOpen (FILE *fd) |
| Open an animated GIF reader from a stdio file. | |
| gdGifReadPtr | gdGifReadOpenCtx (gdIOCtxPtr in) |
| Open an animated GIF reader from a gdIOCtx. | |
| gdGifReadPtr | gdGifReadOpenPtr (int size, void *data) |
| Open an animated GIF reader from a memory buffer. | |
| void | gdGifReadClose (gdGifReadPtr gif) |
| Close an animated GIF reader. | |
| int | gdGifReadGetInfo (gdGifReadPtr gif, gdGifInfo *info) |
| Read logical screen and loop information from a GIF reader. | |
| int | gdGifGetInfo (FILE *file, gdGifInfo *info) |
| Read logical screen and loop information from a GIF stdio file. | |
| int | gdGifGetInfoCtx (gdIOCtxPtr input, gdGifInfo *info) |
| Read logical screen and loop information from a seekable gdIOCtx. | |
| int | gdGifGetInfoPtr (int size, const void *data, gdGifInfo *info) |
| Read logical screen and loop information from a GIF memory buffer. | |
| int | gdGifReadNextFrame (gdGifReadPtr gif, gdGifFrameInfo *info, gdImagePtr *frame) |
| Read the next raw GIF frame. | |
| int | gdGifReadNextImage (gdGifReadPtr gif, gdGifFrameInfo *info, gdImagePtr *image) |
| Read the next GIF frame composited onto the logical screen. | |
Single-frame GIF reading and writing | |
| gdImagePtr | gdImageCreateFromGif (FILE *fd) |
| Create an image from the first frame of a GIF stdio file. | |
| gdImagePtr | gdImageCreateFromGifCtx (gdIOCtxPtr in) |
| Create an image from the first frame of GIF data read through a gdIOCtx. | |
| gdImagePtr | gdImageCreateFromGifPtr (int size, void *data) |
| Create an image from the first frame of a GIF memory buffer. | |
| void | gdImageGifCtx (gdImagePtr im, gdIOCtxPtr out) |
| Write an image as GIF data to a gdIOCtx. | |
| void | gdImageGif (gdImagePtr im, FILE *out) |
| Write an image as GIF data to a stdio file. | |
| void * | gdImageGifPtr (gdImagePtr im, int *size) |
| Write an image as GIF data to a newly allocated memory buffer. | |
Animated GIF writing | |
| void | gdImageGifAnimBegin (gdImagePtr im, FILE *outFile, int GlobalCM, int Loops) |
| Begin writing a GIF animation to a stdio file. | |
| void | gdImageGifAnimAdd (gdImagePtr im, FILE *outFile, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm) |
| Add a frame to a GIF animation written to a stdio file. | |
| void | gdImageGifAnimEnd (FILE *outFile) |
| Finish writing a GIF animation to a stdio file. | |
| void | gdImageGifAnimBeginCtx (gdImagePtr im, gdIOCtxPtr out, int GlobalCM, int Loops) |
| Begin writing a GIF animation to a gdIOCtx. | |
| void | gdImageGifAnimAddCtx (gdImagePtr im, gdIOCtxPtr out, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm) |
| Add a frame to a GIF animation written to a gdIOCtx. | |
| void | gdImageGifAnimEndCtx (gdIOCtxPtr out) |
| Finish writing a GIF animation to a gdIOCtx. | |
| void * | gdImageGifAnimBeginPtr (gdImagePtr im, int *size, int GlobalCM, int Loops) |
| Begin writing a GIF animation to a newly allocated memory buffer. | |
| void * | gdImageGifAnimAddPtr (gdImagePtr im, int *size, int LocalCM, int LeftOfs, int TopOfs, int Delay, int Disposal, gdImagePtr previm) |
| Add a GIF animation frame to a newly allocated memory buffer. | |
| void * | gdImageGifAnimEndPtr (int *size) |
| Finish a GIF animation into a newly allocated memory buffer. | |
GIF image and animation reading and writing support.
GIF support reads single images as palette-based gd images and writes palette-based GIF data, quantizing truecolor input when needed. Animated GIF support includes a reader for raw frames or composited images and a legacy begin/add/end writer API.
| #define GD_GIF_DISPOSAL_NONE gdDisposalNone |
Alias for gdDisposalNone.
| #define GD_GIF_DISPOSAL_RESTORE_BACKGROUND gdDisposalRestoreBackground |
Alias for gdDisposalRestoreBackground.
| #define GD_GIF_DISPOSAL_RESTORE_PREVIOUS gdDisposalRestorePrevious |
Alias for gdDisposalRestorePrevious.
| #define GD_GIF_DISPOSAL_UNKNOWN gdDisposalUnknown |
Alias for gdDisposalUnknown.
| anonymous enum |
GIF frame disposal methods.
| int gdGifGetInfo | ( | FILE * | file, |
| gdGifInfo * | info | ||
| ) |
Read logical screen and loop information from a GIF stdio file.
The input stream position is restored before returning.
| int gdGifGetInfoCtx | ( | gdIOCtxPtr | input, |
| gdGifInfo * | info | ||
| ) |
Read logical screen and loop information from a seekable gdIOCtx.
The input context position is restored before returning.
| int gdGifIsAnimated | ( | FILE * | fd | ) |
Test whether a seekable GIF stdio file contains more than one frame.
| fd | Pointer to the input FILE stream. |
| int gdGifIsAnimatedCtx | ( | gdIOCtxPtr | in | ) |
Test whether a seekable GIF gdIOCtx contains more than one frame.
| in | Pointer to the gdIOCtx input context. |
| int gdGifIsAnimatedPtr | ( | int | size, |
| void * | data | ||
| ) |
Test whether a GIF memory buffer contains more than one frame.
| size | Size of the GIF memory buffer in bytes. |
| data | Pointer to the GIF memory buffer. |
| void gdGifReadClose | ( | gdGifReadPtr | gif | ) |
Close an animated GIF reader.
| gif | The GIF reader to close. |
| int gdGifReadGetInfo | ( | gdGifReadPtr | gif, |
| gdGifInfo * | info | ||
| ) |
Read logical screen and loop information from a GIF reader.
| gif | The GIF reader. |
| info | Pointer to the gdGifInfo structure to populate. |
| int gdGifReadNextFrame | ( | gdGifReadPtr | gif, |
| gdGifFrameInfo * | info, | ||
| gdImagePtr * | frame | ||
| ) |
Read the next raw GIF frame.
| gif | The GIF reader. |
| info | Pointer to a gdGifFrameInfo structure to populate, or NULL. |
| frame | Pointer to receive a caller-owned raw frame image, or NULL to skip receiving the image. |
| int gdGifReadNextImage | ( | gdGifReadPtr | gif, |
| gdGifFrameInfo * | info, | ||
| gdImagePtr * | image | ||
| ) |
Read the next GIF frame composited onto the logical screen.
| gif | The GIF reader. |
| info | Pointer to a gdGifFrameInfo structure to populate, or NULL. |
| image | Pointer to receive a caller-owned composited image, or NULL to skip receiving the image. |
| gdGifReadPtr gdGifReadOpen | ( | FILE * | fd | ) |
Open an animated GIF reader from a stdio file.
| fd | Pointer to the input FILE stream. |
| gdGifReadPtr gdGifReadOpenCtx | ( | gdIOCtxPtr | in | ) |
Open an animated GIF reader from a gdIOCtx.
| in | Pointer to the gdIOCtx input context. The reader does not take ownership of this context. |
| gdGifReadPtr gdGifReadOpenPtr | ( | int | size, |
| void * | data | ||
| ) |
Open an animated GIF reader from a memory buffer.
| size | Size of the GIF memory buffer in bytes. |
| data | Pointer to the GIF memory buffer. |
| gdImagePtr gdImageCreateFromGif | ( | FILE * | fd | ) |
Create an image from the first frame of a GIF stdio file.
| fd | Pointer to the input FILE stream. |
| gdImagePtr gdImageCreateFromGifCtx | ( | gdIOCtxPtr | in | ) |
Create an image from the first frame of GIF data read through a gdIOCtx.
| in | Pointer to the gdIOCtx input context. |
| gdImagePtr gdImageCreateFromGifPtr | ( | int | size, |
| void * | data | ||
| ) |
Create an image from the first frame of a GIF memory buffer.
| size | Size of the GIF memory buffer in bytes. |
| data | Pointer to the GIF memory buffer. |
| void gdImageGif | ( | gdImagePtr | im, |
| FILE * | out | ||
| ) |
Write an image as GIF data to a stdio file.
| im | The image to write. |
| out | The stdio file to write the GIF data to. |
| void gdImageGifAnimAdd | ( | gdImagePtr | im, |
| FILE * | outFile, | ||
| int | LocalCM, | ||
| int | LeftOfs, | ||
| int | TopOfs, | ||
| int | Delay, | ||
| int | Disposal, | ||
| gdImagePtr | previm | ||
| ) |
Add a frame to a GIF animation written to a stdio file.
| im | The frame image to add. |
| outFile | The stdio file to write to. |
| LocalCM | Local color table flag: 1 to write one, 0 to use the global color table, or -1 for the default. |
| LeftOfs | Frame left offset on the logical screen. |
| TopOfs | Frame top offset on the logical screen. |
| Delay | Frame delay in hundredths of a second. |
| Disposal | One of the GD_GIF_DISPOSAL_* constants. |
| previm | Previous frame image for built-in optimization, or NULL. |
| void gdImageGifAnimAddCtx | ( | gdImagePtr | im, |
| gdIOCtxPtr | out, | ||
| int | LocalCM, | ||
| int | LeftOfs, | ||
| int | TopOfs, | ||
| int | Delay, | ||
| int | Disposal, | ||
| gdImagePtr | previm | ||
| ) |
Add a frame to a GIF animation written to a gdIOCtx.
| im | The frame image to add. |
| out | The gdIOCtx to write to. |
| LocalCM | Local color table flag: 1 to write one, 0 to use the global color table, or -1 for the default. |
| LeftOfs | Frame left offset on the logical screen. |
| TopOfs | Frame top offset on the logical screen. |
| Delay | Frame delay in hundredths of a second. |
| Disposal | One of the GD_GIF_DISPOSAL_* constants. |
| previm | Previous frame image for built-in optimization, or NULL. |
| void * gdImageGifAnimAddPtr | ( | gdImagePtr | im, |
| int * | size, | ||
| int | LocalCM, | ||
| int | LeftOfs, | ||
| int | TopOfs, | ||
| int | Delay, | ||
| int | Disposal, | ||
| gdImagePtr | previm | ||
| ) |
Add a GIF animation frame to a newly allocated memory buffer.
| im | The frame image to add. |
| size | Pointer to an integer that receives the returned buffer size. |
| LocalCM | Local color table flag: 1 to write one, 0 to use the global color table, or -1 for the default. |
| LeftOfs | Frame left offset on the logical screen. |
| TopOfs | Frame top offset on the logical screen. |
| Delay | Frame delay in hundredths of a second. |
| Disposal | One of the GD_GIF_DISPOSAL_* constants. |
| previm | Previous frame image for built-in optimization, or NULL. |
| void gdImageGifAnimBegin | ( | gdImagePtr | im, |
| FILE * | outFile, | ||
| int | GlobalCM, | ||
| int | Loops | ||
| ) |
Begin writing a GIF animation to a stdio file.
| im | Reference image used for logical screen size, interlace flag, and optional global color table. |
| outFile | The stdio file to write to. |
| GlobalCM | Global color table flag: 1 to write one, 0 to omit it, or -1 for the default. |
| Loops | Loop count: 0 for infinite looping, -1 to omit the loop extension, or a positive finite loop count. |
| void gdImageGifAnimBeginCtx | ( | gdImagePtr | im, |
| gdIOCtxPtr | out, | ||
| int | GlobalCM, | ||
| int | Loops | ||
| ) |
Begin writing a GIF animation to a gdIOCtx.
| im | Reference image used for logical screen size, interlace flag, and optional global color table. |
| out | The gdIOCtx to write to. |
| GlobalCM | Global color table flag: 1 to write one, 0 to omit it, or -1 for the default. |
| Loops | Loop count: 0 for infinite looping, -1 to omit the loop extension, or a positive finite loop count. |
| void * gdImageGifAnimBeginPtr | ( | gdImagePtr | im, |
| int * | size, | ||
| int | GlobalCM, | ||
| int | Loops | ||
| ) |
Begin writing a GIF animation to a newly allocated memory buffer.
| im | Reference image used for logical screen size, interlace flag, and optional global color table. |
| size | Pointer to an integer that receives the returned buffer size. |
| GlobalCM | Global color table flag: 1 to write one, 0 to omit it, or -1 for the default. |
| Loops | Loop count: 0 for infinite looping, -1 to omit the loop extension, or a positive finite loop count. |
| void gdImageGifAnimEnd | ( | FILE * | outFile | ) |
Finish writing a GIF animation to a stdio file.
| outFile | The stdio file to write to. |
| void gdImageGifAnimEndCtx | ( | gdIOCtxPtr | out | ) |
Finish writing a GIF animation to a gdIOCtx.
| out | The gdIOCtx to write to. |
| void * gdImageGifAnimEndPtr | ( | int * | size | ) |
Finish a GIF animation into a newly allocated memory buffer.
| size | Pointer to an integer that receives the returned buffer size. |
| void gdImageGifCtx | ( | gdImagePtr | im, |
| gdIOCtxPtr | out | ||
| ) |
Write an image as GIF data to a gdIOCtx.
| im | The image to write. |
| out | The gdIOCtx to write the GIF data to. |
| void * gdImageGifPtr | ( | gdImagePtr | im, |
| int * | size | ||
| ) |
Write an image as GIF data to a newly allocated memory buffer.
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |