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

Namespaces | |
| namespace | im |
| Write an image as JPEG data to a gdIOCtx. | |
Data Structures | |
| struct | gdJpegInfo |
| Basic information read from a JPEG header. More... | |
| struct | gdJpegReadOptions |
| Options for reading JPEG data. More... | |
| struct | gdJpegWriteOptions |
| Options for writing JPEG data. More... | |
Enumerations | |
| enum | { GD_JPEG_COLOR_SPACE_UNKNOWN = 0 , GD_JPEG_COLOR_SPACE_GRAYSCALE = 1 , GD_JPEG_COLOR_SPACE_RGB = 2 , GD_JPEG_COLOR_SPACE_YCBCR = 3 , GD_JPEG_COLOR_SPACE_CMYK = 4 , GD_JPEG_COLOR_SPACE_YCCK = 5 } |
| JPEG color space identifiers reported by gdJpegInfo. More... | |
| enum | { GD_JPEG_DENSITY_UNIT_NONE = 0 , GD_JPEG_DENSITY_UNIT_DPI = 1 , GD_JPEG_DENSITY_UNIT_DPCM = 2 } |
| JPEG density units reported by gdJpegInfo. More... | |
| enum | { GD_JPEG_DCT_DEFAULT = 0 , GD_JPEG_DCT_SLOW = 1 , GD_JPEG_DCT_FAST = 2 , GD_JPEG_DCT_FLOAT = 3 } |
| JPEG DCT method options for gdJpegReadOptions. More... | |
Functions | |
| void | gdJpegInfoInit (gdJpegInfo *info) |
| Initialize a gdJpegInfo structure with default values. | |
| void | gdJpegReadOptionsInit (gdJpegReadOptions *options) |
| Initialize JPEG read options with default values. | |
| void | gdJpegWriteOptionsInit (gdJpegWriteOptions *options) |
| Initialize JPEG write options with default values. | |
| int | gdJpegGetInfo (FILE *infile, gdJpegInfo *info) |
| Read JPEG header information from a stdio file. | |
| int | gdJpegGetInfoCtx (gdIOCtxPtr infile, gdJpegInfo *info) |
| Read JPEG header information from a gdIOCtx. | |
| int | gdJpegGetInfoPtr (int size, const void *data, gdJpegInfo *info) |
| Read JPEG header information from a memory buffer. | |
| gdImagePtr | gdImageCreateFromJpeg (FILE *infile) |
| Create an image from a JPEG stdio file. | |
| gdImagePtr | gdImageCreateFromJpegEx (FILE *infile, int ignore_warning) |
| Create an image from a JPEG stdio file, controlling warning handling. | |
| gdImagePtr | gdImageCreateFromJpegCtx (gdIOCtxPtr infile) |
| Create an image from JPEG data read through a gdIOCtx. | |
| gdImagePtr | gdImageCreateFromJpegCtxEx (gdIOCtxPtr infile, int ignore_warning) |
| Create an image from a JPEG gdIOCtx, controlling warning handling. | |
| gdImagePtr | gdImageCreateFromJpegCtxWithOptions (gdIOCtxPtr infile, const gdJpegReadOptions *options) |
| Create an image from a JPEG gdIOCtx and collect metadata. | |
| gdImagePtr | gdImageCreateFromJpegPtr (int size, void *data) |
| Create an image from a JPEG memory buffer. | |
| gdImagePtr | gdImageCreateFromJpegPtrEx (int size, void *data, int ignore_warning) |
| Create an image from a JPEG memory buffer, controlling warning handling. | |
| gdImagePtr | gdImageCreateFromJpegPtrWithOptions (int size, void *data, const gdJpegReadOptions *options) |
| Create an image from a JPEG memory buffer using read options. | |
| const char * | gdJpegGetVersionString () |
| Create an image from a JPEG memory buffer and collect metadata. | |
| void | gdImageJpeg (gdImagePtr im, FILE *out, int quality) |
| Write an image as JPEG data to a stdio file. | |
| int | gdImageJpegWithOptions (gdImagePtr im, FILE *out, const gdJpegWriteOptions *options) |
| Write an image as JPEG data to a gdIOCtx with metadata. | |
| int | gdImageJpegCtxWithOptions (gdImagePtr im, gdIOCtxPtr out, const gdJpegWriteOptions *options) |
| Write an image as JPEG data to a gdIOCtx using write options. | |
| void * | gdImageJpegPtr (gdImagePtr im, int *size, int quality) |
| Write an image as JPEG data to a newly allocated memory buffer. | |
| void * | gdImageJpegPtrWithOptions (gdImagePtr im, int *size, const gdJpegWriteOptions *options) |
| Write an image as JPEG data to a memory buffer with metadata. | |
JPEG image reading and writing support.
GD supports a range of raster codecs for loading and saving images, including JPEG, PNG, GIF, WebP, and others. Each codec is exposed as its own subgroup with format-specific options and functions.
| anonymous enum |
JPEG color space identifiers reported by gdJpegInfo.
| anonymous enum |
JPEG density units reported by gdJpegInfo.
| Enumerator | |
|---|---|
| GD_JPEG_DENSITY_UNIT_NONE | No density unit is specified. |
| GD_JPEG_DENSITY_UNIT_DPI | Density is measured in dots per inch. |
| GD_JPEG_DENSITY_UNIT_DPCM | Density is measured in dots per centimeter. |
| anonymous enum |
JPEG DCT method options for gdJpegReadOptions.
| gdImagePtr gdImageCreateFromJpeg | ( | FILE * | infile | ) |
Create an image from a JPEG stdio file.
| infile | Pointer to the input FILE stream. |
| gdImagePtr gdImageCreateFromJpegCtx | ( | gdIOCtxPtr | infile | ) |
Create an image from JPEG data read through a gdIOCtx.
| infile | Pointer to the gdIOCtx input context. |
| gdImagePtr gdImageCreateFromJpegCtxEx | ( | gdIOCtxPtr | infile, |
| int | ignore_warning | ||
| ) |
Create an image from a JPEG gdIOCtx, controlling warning handling.
| infile | Pointer to the gdIOCtx input context. |
| ignore_warning | Non-zero to suppress recoverable JPEG warnings. |
| gdImagePtr gdImageCreateFromJpegCtxWithOptions | ( | gdIOCtxPtr | infile, |
| const gdJpegReadOptions * | options | ||
| ) |
Create an image from a JPEG gdIOCtx and collect metadata.
| infile | Pointer to the gdIOCtx input context. |
| metadata | Pointer to a gdImageMetadata structure to collect metadata. |
Create an image from a JPEG gdIOCtx with warning control and metadata collection.
| infile | Pointer to the gdIOCtx input context. |
| ignore_warning | Non-zero to suppress recoverable JPEG warnings. |
| metadata | Pointer to a gdImageMetadata structure to collect metadata. |
Create an image from a JPEG gdIOCtx using read options.
| infile | Pointer to the gdIOCtx input context. |
| options | Pointer to a gdJpegReadOptions structure specifying read options. |
| gdImagePtr gdImageCreateFromJpegEx | ( | FILE * | infile, |
| int | ignore_warning | ||
| ) |
Create an image from a JPEG stdio file, controlling warning handling.
| infile | Pointer to the input FILE stream. |
| ignore_warning | Non-zero to suppress recoverable JPEG warnings. |
| gdImagePtr gdImageCreateFromJpegPtr | ( | int | size, |
| void * | data | ||
| ) |
Create an image from a JPEG memory buffer.
| size | The size of the JPEG memory buffer. |
| data | Pointer to the JPEG memory buffer. |
| gdImagePtr gdImageCreateFromJpegPtrEx | ( | int | size, |
| void * | data, | ||
| int | ignore_warning | ||
| ) |
Create an image from a JPEG memory buffer, controlling warning handling.
| size | The size of the JPEG memory buffer. |
| data | Pointer to the JPEG memory buffer. |
| ignore_warning | Non-zero to suppress recoverable JPEG warnings. |
| gdImagePtr gdImageCreateFromJpegPtrWithOptions | ( | int | size, |
| void * | data, | ||
| const gdJpegReadOptions * | options | ||
| ) |
Create an image from a JPEG memory buffer using read options.
| size | The size of the JPEG memory buffer. |
| data | Pointer to the JPEG memory buffer. |
| options | Pointer to a gdJpegReadOptions structure specifying read options. |
| void gdImageJpeg | ( | gdImagePtr | im, |
| FILE * | out, | ||
| int | quality | ||
| ) |
Write an image as JPEG data to a stdio file.
100 is the highest quality (there is always a little loss with JPEG). 0 is the lowest quality. 10 is about the lowest useful setting.
| im | The image to write. |
| out | The stdio file to write the JPEG data to. |
| quality | The JPEG quality (0-100). |
| int gdImageJpegCtxWithOptions | ( | gdImagePtr | im, |
| gdIOCtxPtr | out, | ||
| const gdJpegWriteOptions * | options | ||
| ) |
Write an image as JPEG data to a gdIOCtx using write options.
| im | The image to write. |
| out | The gdIOCtx to write the JPEG data to. |
| options | Pointer to a gdJpegWriteOptions struct containing the desired write options. |
| void * gdImageJpegPtr | ( | gdImagePtr | im, |
| int * | size, | ||
| int | quality | ||
| ) |
Write an image as JPEG data to a newly allocated memory buffer.
Result must be freed with gdFree(). The image is borrowed for the duration of the call.
| im | The image to write. |
| size | Pointer to an integer that will receive the size of the returned buffer. |
| quality | The JPEG quality (0-100). |
| void * gdImageJpegPtrWithOptions | ( | gdImagePtr | im, |
| int * | size, | ||
| const gdJpegWriteOptions * | options | ||
| ) |
Write an image as JPEG data to a memory buffer with metadata.
| im | The image to write. |
| size | Pointer to an integer that will receive the size of the returned buffer. |
| quality | The JPEG quality (0-100). |
| metadata | Pointer to a gdImageMetadata structure containing the metadata to include in the JPEG file. |
Write an image as JPEG data to a memory buffer using write options.
| im | The image to write. |
| size | Pointer to an integer that will receive the size of the returned buffer. |
| options | Pointer to a gdJpegWriteOptions struct containing the desired write options. |
| int gdImageJpegWithOptions | ( | gdImagePtr | im, |
| FILE * | out, | ||
| const gdJpegWriteOptions * | options | ||
| ) |
Write an image as JPEG data to a gdIOCtx with metadata.
| im | The image to write. |
| out | The gdIOCtx to write the JPEG data to. |
| quality | The JPEG quality (0-100). |
| metadata | Pointer to a gdImageMetadata structure containing the metadata to include in the JPEG file. |
Write an image as JPEG data to a stdio file using write options.
| im | The image to write. |
| out | The stdio file to write the JPEG data to. |
| options | Pointer to a gdJpegWriteOptions struct containing the desired write options. |
| int gdJpegGetInfo | ( | FILE * | infile, |
| gdJpegInfo * | info | ||
| ) |
Read JPEG header information from a stdio file.
| infile | Pointer to the input FILE stream. |
| info | Pointer to the gdJpegInfo structure to populate with header information. |
| int gdJpegGetInfoCtx | ( | gdIOCtxPtr | infile, |
| gdJpegInfo * | info | ||
| ) |
Read JPEG header information from a gdIOCtx.
| infile | Pointer to the gdIOCtx input context. |
| info | Pointer to the gdJpegInfo structure to populate with header information. |
| int gdJpegGetInfoPtr | ( | int | size, |
| const void * | data, | ||
| gdJpegInfo * | info | ||
| ) |
Read JPEG header information from a memory buffer.
| size | Size of the memory buffer. |
| data | Pointer to the memory buffer containing JPEG data. |
| info | Pointer to the gdJpegInfo structure to populate with header information. |
| const char * gdJpegGetVersionString | ( | ) |
Create an image from a JPEG memory buffer and collect metadata.
Create a JPEG image from memory using read options and collect metadata.
| size | The size of the JPEG memory buffer. |
| data | Pointer to the JPEG memory buffer. |
| metadata | Pointer to a gdImageMetadata structure to collect metadata. |
Create an image from a JPEG memory buffer with warning control and metadata collection.
| size | The size of the JPEG memory buffer. |
| data | Pointer to the JPEG memory buffer. |
| ignore_warning | Non-zero to suppress recoverable JPEG warnings. |
| metadata | Pointer to a gdImageMetadata structure to collect metadata. |
Return a string describing the linked JPEG library version.
| void gdJpegInfoInit | ( | gdJpegInfo * | info | ) |
Initialize a gdJpegInfo structure with default values.
| info | Pointer to the gdJpegInfo structure to initialize. |
| void gdJpegReadOptionsInit | ( | gdJpegReadOptions * | options | ) |
Initialize JPEG read options with default values.
| options | Pointer to the gdJpegReadOptions structure to initialize. |
| void gdJpegWriteOptionsInit | ( | gdJpegWriteOptions * | options | ) |
Initialize JPEG write options with default values.
| options | Pointer to the gdJpegWriteOptions structure to initialize. |