JPEG api structure version 20190717. More...
#include "jpegapi.h"
Data Fields | |
HqBool(* | decompress_init )(void **p_priv, const jpeg_callbacks *callbacks, const jpeg_decode_params *params, void *source_data, int *p_bufsize) |
Prepare to decompress a JPEG image. More... | |
HqBool(* | decompress_read )(void *priv, uint8 *buffer, int *p_ret_bytes) |
Read decompressed image data into a buffer provided. More... | |
int(* | unconsumed_byte_count )(uint8 *end_of_buffer, void *priv) |
Return the number of bytes in the source data buffer that the API implementation did not consume. More... | |
void(* | decompress_close )(void **p_priv) |
Dispose of a decompression context created by decompress_init() . More... | |
JPEG api structure version 20190717.
Allow alternate JPEG implementations to be registered via RDR, and then used instead of the HQN JPEG code. This API is just used for decompression.
void( * sw_jpeg_api_20190717::decompress_close) (void **p_priv) |
Dispose of a decompression context created by decompress_init()
.
[in,out] | p_priv | A pointer to the context pointer created by decompress_init() . The API implementation should free any data allocated, and set the context to NULL. |
This call will always be made if decompress_init()
succeeded and returned a non-NULL context pointer.
HqBool( * sw_jpeg_api_20190717::decompress_init) (void **p_priv, const jpeg_callbacks *callbacks, const jpeg_decode_params *params, void *source_data, int *p_bufsize) |
Prepare to decompress a JPEG image.
[out] | p_priv | A pointer to an opaque context created and maintained by the alternate JPEG implementation. This pointer can be used by the API implementation to store information about the state of this decompression. If this function returns TRUE, it must set this context pointer to a non-NULL value. |
[in] | callbacks | A pointer to a structure containing callback function pointers to provides access the source data and RIP integration functions such as memory allocation and deallocation. The callbacks structure should be copied into memory owned by the API implementation if it is to be retained; the structure pointed to by the parameter may be invalidated as soon as this function returns. |
[in] | params | A pointer to a structure containing any input decode parameters that may be defined. The parameters structure should be copied into memory owned by the API implementation if it is to be retained; the structure pointed to by the parameter may be invalidated as soon as this function returns. |
[in] | source_data | An opaque pointer to the source data. This pointer should be saved by the implementation and passed to the jpeg_callbacks::source() function. |
[out] | p_bufsize | A buffer size suitable for the API implementation to read JPEG image data. Data is provided to the jpeg_callbacks::source() function in buffers of this size. This function must set the buffer size to a suitable value. |
TRUE | The implementation is ready to decompress JPEG data. If this function returns TRUE and sets p_priv to a non-NULL value, the decompress_close() method will be called at some future point. |
FALSE | The implementation cannot initialise decompression of the JPEG data. An error will be reported by the RIP. |
Read decompressed image data into a buffer provided.
[in] | priv | The decompression context pointer created by decompress_init() . |
[out] | buffer | A pointer to a buffer where the decoded image data will be stored by the JPEG decoder implementation. |
[in,out] | p_ret_bytes | A pointer to the number of bytes in buffer. On entry, this is set to the maximum number of bytes that can be stored in buffer. The JPEG decoder implementation should not store more than this number of bytes in the buffer. On a successful exit, the JPEG decoder should update this value with the actual number of bytes stored in buffer. |
TRUE | The JPEG decoder provided some image data to the RIP. The data has been stored in buffer, and the value in *p_ret_bytes has been updated with the actual number of bytes decoded. |
FALSE | The JPEG decoder encountered an error decoding the image data. The RIP will report an error. |
int( * sw_jpeg_api_20190717::unconsumed_byte_count) (uint8 *end_of_buffer, void *priv) |
Return the number of bytes in the source data buffer that the API implementation did not consume.
[in] | end_of_buffer | A pointer to the end of the buffer supplied to the last jpeg_callbacks::source() callback. This pointer will be greater than the address of the last byte consumed by the JPEG decoder implementation. |
[in] | priv | The decompression context pointer created by decompress_init() . |
jpeg_callbacks::source()
buffer requested.