Callback structure provided by the RIP to the JPEG implementation, for access to RIP memory handling and JPEG data source. More...
#include "jpegapi.h"
Data Fields | |
| size_t | size |
| Size of this structure. More... | |
| void *(* | alloc )(size_t size) |
| Allocate a block of memory from the RIP. More... | |
| void(* | free )(void *memory) |
| Free a block of memory previously allocated from the RIP. More... | |
| HqBool(* | source )(void *source_data, size_t *bytes_read, const uint8 **buffer) |
| Callback to read the underlying source. More... | |
| void(* | onerror )(void *source_data, struct jpeg_decode_error *error) |
| Callback to report an error during JPEG decoding. More... | |
| void(* | onwarning )(void *source_data, struct jpeg_decode_warning *warning) |
| Callback to report warnings during JPEG decoding. More... | |
Callback structure provided by the RIP to the JPEG implementation, for access to RIP memory handling and JPEG data source.
The JPEG implementation should copy the callback pointers provided in this structure into its own memory, and use them to allocate and free memory required to decode the JPEG data, access the raw compressed JPEG source data, and report errors and warnings.
| void*( * jpeg_callbacks::alloc) (size_t size) |
Allocate a block of memory from the RIP.
| size | The size of the block of memory to allocate. |
The JPEG implementation should use this call in preference to system malloc() so that the RIP can account for the memory used and handle low memory situations effectively.
| void( * jpeg_callbacks::free) (void *memory) |
Free a block of memory previously allocated from the RIP.
| memory | A memory pointer previously returned by the jpeg_callbacks::alloc() call. After calling this function, the memory should not be dereferenced. |
| void( * jpeg_callbacks::onerror) (void *source_data, struct jpeg_decode_error *error) |
Callback to report an error during JPEG decoding.
| [in] | source_data | The opaque data source, as provided to the decompress_init() call. |
| [in] | error | A pointer to the details for the error that has occurred during JPEG decoding. |
| void( * jpeg_callbacks::onwarning) (void *source_data, struct jpeg_decode_warning *warning) |
Callback to report warnings during JPEG decoding.
| [in] | source_data | The opaque data source, as provided to the decompress_init() call. |
| [in] | warning | A pointer to a warning that has been generated during JPEG decoding. |
| size_t jpeg_callbacks::size |
Size of this structure.
This must be set correctly so that parameters for new versions of the JPEG API will be set to sensible default values if linked with older clients.
Callback to read the underlying source.
| [in] | source_data | The opaque data source, as provided to the decompress_init() call. |
| [out] | bytes_read | A pointer to the number of bytes read from the source. If no data was read, this will be set to zero. |
| [out] | buffer | A pointer to the data buffer read from the source. If no data was read, this will be set to NULL. |
| TRUE | If the call read data from the image source. |
| FALSE | If there was no more data to read, or there was an error reading data from the image source. |