Harlequin RIP SDK
sw_jpeg_api_20190717 Struct Reference

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...
 

Detailed Description

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.

Field Documentation

◆ decompress_close

void( * sw_jpeg_api_20190717::decompress_close) (void **p_priv)

Dispose of a decompression context created by decompress_init().

Parameters
[in,out]p_privA 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.

◆ decompress_init

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.

Parameters
[out]p_privA 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]callbacksA 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]paramsA 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_dataAn opaque pointer to the source data. This pointer should be saved by the implementation and passed to the jpeg_callbacks::source() function.
[out]p_bufsizeA 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.
Return values
TRUEThe 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.
FALSEThe implementation cannot initialise decompression of the JPEG data. An error will be reported by the RIP.

◆ decompress_read

HqBool( * sw_jpeg_api_20190717::decompress_read) (void *priv, uint8 *buffer, int *p_ret_bytes)

Read decompressed image data into a buffer provided.

Parameters
[in]privThe decompression context pointer created by decompress_init().
[out]bufferA pointer to a buffer where the decoded image data will be stored by the JPEG decoder implementation.
[in,out]p_ret_bytesA 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.
Return values
TRUEThe 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.
FALSEThe JPEG decoder encountered an error decoding the image data. The RIP will report an error.

◆ unconsumed_byte_count

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.

Parameters
[in]end_of_bufferA 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]privThe decompression context pointer created by decompress_init().
Returns
The number of bytes that the JPEG decoder did not consumer from the last jpeg_callbacks::source() buffer requested.

The documentation for this struct was generated from the following file: