QOI image reading and writing support.
More...
|
| gdImagePtr | gdImageCreateFromQoi (FILE *fd) |
| | Create an image from a QOI stdio file.
|
| |
| gdImagePtr | gdImageCreateFromQoiCtx (gdIOCtxPtr in) |
| | Create an image from QOI data read through a gdIOCtx.
|
| |
| gdImagePtr | gdImageCreateFromQoiPtr (int size, void *data) |
| | Create an image from a QOI memory buffer.
|
| |
| void | gdQoiInfoInit (gdQoiInfo *info) |
| | Initialize a gdQoiInfo structure to default values.
|
| |
| int | gdQoiGetInfo (FILE *infile, gdQoiInfo *info) |
| | Read QOI header information from a stdio file.
|
| |
| int | gdQoiGetInfoCtx (gdIOCtxPtr infile, gdQoiInfo *info) |
| | Read QOI header information from a gdIOCtx.
|
| |
| int | gdQoiGetInfoPtr (int size, const void *data, gdQoiInfo *info) |
| | Read QOI header information from a memory buffer.
|
| |
| void | gdQoiWriteOptionsInit (gdQoiWriteOptions *options) |
| | Initialize a gdQoiWriteOptions structure to default values.
|
| |
| int | gdImageQoiWithOptions (gdImagePtr im, FILE *out, const gdQoiWriteOptions *options) |
| | Write an image as QOI data to a stdio file with options.
|
| |
| int | gdImageQoiCtxWithOptions (gdImagePtr im, gdIOCtxPtr out, const gdQoiWriteOptions *options) |
| | Write an image as QOI data to a gdIOCtx with options.
|
| |
| void * | gdImageQoiPtrWithOptions (gdImagePtr im, int *size, const gdQoiWriteOptions *options) |
| | Write an image as QOI data to a newly allocated memory buffer with options.
|
| |
| void * | gdImageQoiPtr (gdImagePtr im, int *size) |
| | Write an image as QOI data to a newly allocated memory buffer.
|
| |
| void * | gdImageQoiPtrEx (gdImagePtr im, int *size, int colorspace) |
| | Write an image as QOI data to a memory buffer with an explicit colorspace flag.
|
| |
| void | gdImageQoi (gdImagePtr im, FILE *out) |
| | Write an image as QOI data to a memory buffer.
|
| |
| void | gdImageQoiCtx (gdImagePtr im, gdIOCtxPtr out) |
| | Write an image as QOI data to a gdIOCtx.
|
| |
| void | gdImageQoiEx (gdImagePtr im, FILE *out, int colorspace) |
| | Write an image as QOI data to a stdio file with an explicit colorspace flag.
|
| |
| void | gdImageQoiCtxEx (gdImagePtr im, gdIOCtxPtr out, int colorspace) |
| | Write an image as QOI data to a gdIOCtx with an explicit colorspace flag.
|
| |
QOI image reading and writing support.
QOI support reads images as truecolor RGBA gd images with alpha saving enabled. QOI output writes RGBA data for both truecolor and palette images; palette images are expanded through their color table. The colorspace value controls the QOI header colorspace flag and does not transform pixel data.
int black, white;
FILE *out;
im = gdImageCreateTrueColor(100, 100);
fprintf(stderr, "Unable to create image\n");
exit(1);
}
white = gdTrueColor(255, 255, 255);
black = gdTrueColor(0, 0, 0);
out = fopen("rect.qoi", "wb");
if (out == NULL) {
fprintf(stderr, "Unable to open output file\n");
exit(1);
}
fclose(out);
void gdImageRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Draws a rectangle.
Definition gd.c:2239
void gdImageFilledRectangle(gdImagePtr im, int x1, int y1, int x2, int y2, int color)
Draws a filled rectangle.
Definition gd.c:2403
void gdImageQoi(gdImagePtr im, FILE *out)
Write an image as QOI data to a memory buffer.
Definition gd_qoi.c:358
Write an image as JPEG data to a gdIOCtx.
◆ anonymous enum
QOI colorspace flags written to the QOI header.
| Enumerator |
|---|
| GD_QOI_SRGB | Pixel data is encoded with sRGB transfer characteristics.
|
| GD_QOI_LINEAR | Pixel data is encoded with linear transfer characteristics.
|
◆ gdImageCreateFromQoi()
| gdImagePtr gdImageCreateFromQoi |
( |
FILE * |
fd | ) |
|
Create an image from a QOI stdio file.
- Parameters
-
| fd | Pointer to the input FILE stream. |
- Returns
- Returns a gdImagePtr on success, or NULL on failure.
◆ gdImageCreateFromQoiCtx()
| gdImagePtr gdImageCreateFromQoiCtx |
( |
gdIOCtxPtr |
in | ) |
|
Create an image from QOI data read through a gdIOCtx.
- Parameters
-
| in | Pointer to the gdIOCtx input context. |
- Returns
- Returns a gdImagePtr on success, or NULL on failure.
◆ gdImageCreateFromQoiPtr()
| gdImagePtr gdImageCreateFromQoiPtr |
( |
int |
size, |
|
|
void * |
data |
|
) |
| |
Create an image from a QOI memory buffer.
- Parameters
-
| size | Size of the QOI memory buffer in bytes. |
| data | Pointer to the QOI memory buffer. |
- Returns
- Returns a gdImagePtr on success, or NULL on failure.
◆ gdImageQoi()
| void gdImageQoi |
( |
gdImagePtr |
im, |
|
|
FILE * |
out |
|
) |
| |
Write an image as QOI data to a memory buffer.
Write an image as QOI data to a stdio file with an explicit colorspace flag.
- Parameters
-
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |
| metadata | Reserved metadata input parameter; QOI metadata is currently ignored. |
- Returns
- A pointer to the newly allocated QOI data, or NULL on failure.
Write an image as QOI data to a stdio file.
- Parameters
-
| im | The image to write. |
| out | The stdio file to write the QOI data to. |
| im | The image to write. |
| out | The stdio file to write the QOI data to. |
◆ gdImageQoiCtx()
| void gdImageQoiCtx |
( |
gdImagePtr |
im, |
|
|
gdIOCtxPtr |
out |
|
) |
| |
Write an image as QOI data to a gdIOCtx.
Write an image as QOI data to a gdIOCtx with an explicit colorspace flag.
- Parameters
-
| im | The image to write. |
| out | The gdIOCtx to write the QOI data to. |
◆ gdImageQoiCtxEx()
| void gdImageQoiCtxEx |
( |
gdImagePtr |
im, |
|
|
gdIOCtxPtr |
out, |
|
|
int |
colorspace |
|
) |
| |
Write an image as QOI data to a gdIOCtx with an explicit colorspace flag.
- Parameters
-
| im | The image to write. |
| out | The gdIOCtx to write the QOI data to. |
| colorspace | The QOI colorspace flag, either GD_QOI_SRGB or GD_QOI_LINEAR. |
◆ gdImageQoiCtxWithOptions()
| int gdImageQoiCtxWithOptions |
( |
gdImagePtr |
im, |
|
|
gdIOCtxPtr |
out, |
|
|
const gdQoiWriteOptions * |
options |
|
) |
| |
Write an image as QOI data to a gdIOCtx with options.
- Parameters
-
| im | The image to write. |
| out | The gdIOCtx to write the QOI data to. |
| options | Pointer to the gdQoiWriteOptions structure specifying write options. |
- Returns
- Returns 0 on success, or 1 on failure.
◆ gdImageQoiEx()
| void gdImageQoiEx |
( |
gdImagePtr |
im, |
|
|
FILE * |
out, |
|
|
int |
colorspace |
|
) |
| |
Write an image as QOI data to a stdio file with an explicit colorspace flag.
- Parameters
-
| im | The image to write. |
| out | The stdio file to write the QOI data to. |
| colorspace | The QOI colorspace flag, either GD_QOI_SRGB or GD_QOI_LINEAR. |
◆ gdImageQoiPtr()
| void * gdImageQoiPtr |
( |
gdImagePtr |
im, |
|
|
int * |
size |
|
) |
| |
Write an image as QOI data to a newly allocated memory buffer.
- Parameters
-
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |
- Returns
- A pointer to the newly allocated QOI data, or NULL on failure.
◆ gdImageQoiPtrEx()
| void * gdImageQoiPtrEx |
( |
gdImagePtr |
im, |
|
|
int * |
size, |
|
|
int |
colorspace |
|
) |
| |
Write an image as QOI data to a memory buffer with an explicit colorspace flag.
- Parameters
-
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |
| colorspace | The QOI colorspace flag, either GD_QOI_SRGB or GD_QOI_LINEAR. |
- Returns
- A pointer to the newly allocated QOI data, or NULL on failure.
◆ gdImageQoiPtrWithOptions()
| void * gdImageQoiPtrWithOptions |
( |
gdImagePtr |
im, |
|
|
int * |
size, |
|
|
const gdQoiWriteOptions * |
options |
|
) |
| |
Write an image as QOI data to a newly allocated memory buffer with options.
- Parameters
-
| im | The image to write. |
| size | Pointer to an integer that receives the returned buffer size. |
| options | Pointer to the gdQoiWriteOptions structure specifying write options. |
- Returns
- A pointer to the newly allocated QOI data, or NULL on failure.
◆ gdImageQoiWithOptions()
| int gdImageQoiWithOptions |
( |
gdImagePtr |
im, |
|
|
FILE * |
out, |
|
|
const gdQoiWriteOptions * |
options |
|
) |
| |
Write an image as QOI data to a stdio file with options.
- Parameters
-
| im | The image to write. |
| out | The stdio file to write the QOI data to. |
| options | Pointer to the gdQoiWriteOptions structure specifying write options. |
- Returns
- Returns 0 on success, or 1 on failure.
◆ gdQoiGetInfo()
| int gdQoiGetInfo |
( |
FILE * |
infile, |
|
|
gdQoiInfo * |
info |
|
) |
| |
Read QOI header information from a stdio file.
- Parameters
-
| infile | Pointer to the input FILE stream. |
| info | Pointer to the gdQoiInfo structure to populate. |
- Returns
- Returns 0 on success, or 1 on failure.
◆ gdQoiGetInfoCtx()
| int gdQoiGetInfoCtx |
( |
gdIOCtxPtr |
infile, |
|
|
gdQoiInfo * |
info |
|
) |
| |
Read QOI header information from a gdIOCtx.
- Parameters
-
| infile | Pointer to the gdIOCtx input context. |
| info | Pointer to the gdQoiInfo structure to populate. |
- Returns
- Returns 0 on success, or 1 on failure.
◆ gdQoiGetInfoPtr()
| int gdQoiGetInfoPtr |
( |
int |
size, |
|
|
const void * |
data, |
|
|
gdQoiInfo * |
info |
|
) |
| |
Read QOI header information from a memory buffer.
- Parameters
-
| size | Size of the QOI memory buffer in bytes. |
| data | Pointer to the QOI memory buffer. |
| info | Pointer to the gdQoiInfo structure to populate. |
- Returns
- Returns 0 on success, or 1 on failure.
◆ gdQoiInfoInit()
Initialize a gdQoiInfo structure to default values.
The default may change in future versions, so it is recommended to call this function before using the structure. Default values update is not considered a breaking change, but it is still recommended to call this function to ensure proper initialization.
- Parameters
-
| info | Pointer to the gdQoiInfo structure to initialize. |
◆ gdQoiWriteOptionsInit()
Initialize a gdQoiWriteOptions structure to default values.
The default may change in future versions, so it is recommended to call this function before using the structure. Default values update is not considered a breaking change, but it is still recommended to call this function to ensure proper initialization.
- Parameters
-