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

Data Structures | |
| struct | gdPngWriteOptions |
| Options for writing PNG data. More... | |
| struct | gdPngInfo |
| Basic information read from a PNG stream. More... | |
Macros | |
| #define | GD_PNG_FILTER_AUTO 0U |
| #define | GD_PNG_FILTER_NONE (1U << 0) |
| #define | GD_PNG_FILTER_SUB (1U << 1) |
| #define | GD_PNG_FILTER_UP (1U << 2) |
| #define | GD_PNG_FILTER_AVERAGE (1U << 3) |
| #define | GD_PNG_FILTER_PAETH (1U << 4) |
| #define | GD_PNG_FILTER_ALL |
Enumerations | |
| enum | { GD_PNG_COMPRESSION_STRATEGY_DEFAULT = 0 , GD_PNG_COMPRESSION_STRATEGY_FILTERED , GD_PNG_COMPRESSION_STRATEGY_HUFFMAN_ONLY , GD_PNG_COMPRESSION_STRATEGY_RLE , GD_PNG_COMPRESSION_STRATEGY_FIXED } |
| PNG compression strategy values for gdPngWriteOptions. More... | |
Functions | |
| gdImagePtr | gdImageCreateFromPng (FILE *fd) |
| Create an image from a PNG stdio file. | |
| gdImagePtr | gdImageCreateFromPngCtx (gdIOCtxPtr in) |
| Create an image from PNG data read through a gdIOCtx. | |
| gdImagePtr | gdImageCreateFromPngPtr (int size, void *data) |
| Create an image from a PNG memory buffer. | |
| void | gdImagePng (gdImagePtr im, FILE *out) |
| Write an image as PNG data to a stdio file. | |
| void | gdImagePngCtx (gdImagePtr im, gdIOCtxPtr out) |
| Write an image as PNG data to a gdIOCtx. | |
| void | gdImagePngEx (gdImagePtr im, FILE *out, int level) |
| Write an image as PNG data to a stdio file with a compression level. | |
| void | gdImagePngCtxEx (gdImagePtr im, gdIOCtxPtr out, int level) |
| Write an image as PNG data to a gdIOCtx with a compression level. | |
| void * | gdImagePngPtr (gdImagePtr im, int *size) |
| Write an image as PNG data to a newly allocated memory buffer. | |
| void * | gdImagePngPtrEx (gdImagePtr im, int *size, int level) |
| Write an image as PNG data to a memory buffer with a compression level. | |
| void | gdPngWriteOptionsInit (gdPngWriteOptions *options) |
| Initialize PNG write options with default values. | |
| void | gdPngInfoInit (gdPngInfo *info) |
| Initialize a gdPngInfo structure with default values. | |
| int | gdImagePngWithOptions (gdImagePtr im, FILE *out, const gdPngWriteOptions *options) |
| Write an image as PNG data to a stdio file using write options. | |
| int | gdImagePngCtxWithOptions (gdImagePtr im, gdIOCtxPtr out, const gdPngWriteOptions *options) |
| Write an image as PNG data to a gdIOCtx using write options. | |
| void * | gdImagePngPtrWithOptions (gdImagePtr im, int *size, const gdPngWriteOptions *options) |
| Write an image as PNG data to a memory buffer using write options. | |
| int | gdPngGetInfo (FILE *in, gdPngInfo *info) |
| Read PNG header information from a stdio file. | |
| int | gdPngGetInfoCtx (gdIOCtxPtr in, gdPngInfo *info) |
| Read PNG header information from a gdIOCtx. | |
| int | gdPngGetInfoPtr (int size, const void *data, gdPngInfo *info) |
| Read PNG header information from a memory buffer. | |
| const char * | gdPngGetVersionString (void) |
| Return a string describing the linked libpng version. | |
PNG image reading and writing support.
PNG support preserves palette images as palette-based gd images and reads truecolor PNG data as truecolor gd images. PNG output is palette-aware, supports alpha, metadata, compression settings, and libpng filter options.
| #define GD_PNG_FILTER_ALL |
Enable all PNG row filters.
| #define GD_PNG_FILTER_AUTO 0U |
Let libpng choose PNG row filters automatically.
| #define GD_PNG_FILTER_AVERAGE (1U << 3) |
Enable the PNG "Average" row filter.
| #define GD_PNG_FILTER_NONE (1U << 0) |
Enable the PNG "None" row filter.
| #define GD_PNG_FILTER_PAETH (1U << 4) |
Enable the PNG "Paeth" row filter.
| #define GD_PNG_FILTER_SUB (1U << 1) |
Enable the PNG "Sub" row filter.
| #define GD_PNG_FILTER_UP (1U << 2) |
Enable the PNG "Up" row filter.
| anonymous enum |
PNG compression strategy values for gdPngWriteOptions.
| gdImagePtr gdImageCreateFromPng | ( | FILE * | fd | ) |
Create an image from a PNG stdio file.
| fd | Pointer to the input FILE stream. |
| gdImagePtr gdImageCreateFromPngCtx | ( | gdIOCtxPtr | in | ) |
Create an image from PNG data read through a gdIOCtx.
| in | Pointer to the gdIOCtx input context. |
| gdImagePtr gdImageCreateFromPngPtr | ( | int | size, |
| void * | data | ||
| ) |
Create an image from a PNG memory buffer.
| size | Size of the PNG memory buffer in bytes. |
| data | Pointer to the PNG memory buffer. |
| void gdImagePng | ( | gdImagePtr | im, |
| FILE * | out | ||
| ) |
Write an image as PNG data to a stdio file.
| im | The image to write. |
| out | The stdio file to write the PNG data to. |
| void gdImagePngCtx | ( | gdImagePtr | im, |
| gdIOCtxPtr | out | ||
| ) |
Write an image as PNG data to a gdIOCtx.
| im | The image to write. |
| out | The gdIOCtx to write the PNG data to. |
| void gdImagePngCtxEx | ( | gdImagePtr | im, |
| gdIOCtxPtr | out, | ||
| int | level | ||
| ) |
Write an image as PNG data to a gdIOCtx with a compression level.
| im | The image to write. |
| out | The gdIOCtx to write the PNG data to. |
| level | Compression level: 0 for no compression, 1-9 for zlib levels, or -1 for the default. |
| int gdImagePngCtxWithOptions | ( | gdImagePtr | im, |
| gdIOCtxPtr | out, | ||
| const gdPngWriteOptions * | options | ||
| ) |
Write an image as PNG data to a gdIOCtx using write options.
| im | The image to write. |
| out | The gdIOCtx to write the PNG data to. |
| options | Pointer to a gdPngWriteOptions structure, or NULL for defaults. |
| void gdImagePngEx | ( | gdImagePtr | im, |
| FILE * | out, | ||
| int | level | ||
| ) |
Write an image as PNG data to a stdio file with a compression level.
| im | The image to write. |
| out | The stdio file to write the PNG data to. |
| level | Compression level: 0 for no compression, 1-9 for zlib levels, or -1 for the default. |
| void * gdImagePngPtr | ( | gdImagePtr | im, |
| int * | size | ||
| ) |
Write an image as PNG data to a newly allocated memory buffer.
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |
| void * gdImagePngPtrEx | ( | gdImagePtr | im, |
| int * | size, | ||
| int | level | ||
| ) |
Write an image as PNG data to a memory buffer with a compression level.
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |
| level | Compression level: 0 for no compression, 1-9 for zlib levels, or -1 for the default. |
| void * gdImagePngPtrWithOptions | ( | gdImagePtr | im, |
| int * | size, | ||
| const gdPngWriteOptions * | options | ||
| ) |
Write an image as PNG data to a memory buffer using write options.
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |
| options | Pointer to a gdPngWriteOptions structure, or NULL for defaults. |
| int gdImagePngWithOptions | ( | gdImagePtr | im, |
| FILE * | out, | ||
| const gdPngWriteOptions * | options | ||
| ) |
Write an image as PNG data to a stdio file using write options.
| im | The image to write. |
| out | The stdio file to write the PNG data to. |
| options | Pointer to a gdPngWriteOptions structure, or NULL for defaults. |
| int gdPngGetInfo | ( | FILE * | in, |
| gdPngInfo * | info | ||
| ) |
Read PNG header information from a stdio file.
| in | Pointer to the input FILE stream. |
| info | Pointer to the gdPngInfo structure to populate. |
| int gdPngGetInfoCtx | ( | gdIOCtxPtr | in, |
| gdPngInfo * | info | ||
| ) |
Read PNG header information from a gdIOCtx.
| in | Pointer to the gdIOCtx input context. |
| info | Pointer to the gdPngInfo structure to populate. |
| int gdPngGetInfoPtr | ( | int | size, |
| const void * | data, | ||
| gdPngInfo * | info | ||
| ) |
Read PNG header information from a memory buffer.
| size | Size of the PNG memory buffer in bytes. |
| data | Pointer to the PNG memory buffer. |
| info | Pointer to the gdPngInfo structure to populate. |
| const char * gdPngGetVersionString | ( | void | ) |
Return a string describing the linked libpng version.
| void gdPngInfoInit | ( | gdPngInfo * | info | ) |
| void gdPngWriteOptionsInit | ( | gdPngWriteOptions * | options | ) |
Initialize PNG write options with default values.
| options | Pointer to the gdPngWriteOptions structure to initialize. |