Context¶
Data types¶
-
spng_ctx
¶ Context handle.
Note
The context handle has no public members.
-
spng_crc_action
¶
enum spng_crc_action
{
SPNG_CRC_ERROR = 0, /* Default */
SPNG_CRC_DISCARD = 1, /* Discard chunk, invalid for critical chunks */
SPNG_CRC_USE = 2 /* Ignore and don't calculate checksum */
};
API¶
-
spng_ctx *
spng_ctx_new2
(struct spng_alloc *alloc, int flags)¶ Creates a new context with a custom memory allocator,
alloc
must be non-NULL.
-
int
spng_set_image_limits
(spng_ctx *ctx, uint32_t width, uint32_t height)¶ Set image width and height limits, these may not be larger than 231-1.
-
int
spng_get_image_limits
(spng_ctx *ctx, uint32_t *width, uint32_t *height)¶ Get image width and height limits.
*width
and*height
must be non-NULL.
-
int
spng_set_crc_action
(spng_ctx *ctx, int critical, int ancillary)¶ Set how chunk CRC errors should be handled for critical and ancillary chunks.
Note
Partially implemented, SPNG_CRC_DISCARD
has no effect.