Harlequin RIP SDK
jpeg_callbacks Struct Reference

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

Detailed Description

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, and access the raw compressed JPEG source data.

Field Documentation

◆ alloc

void*( * jpeg_callbacks::alloc) (size_t size)

Allocate a block of memory from the RIP.

Parameters
sizeThe size of the block of memory to allocate.
Returns
A pointer to the block of memory allocated, or NULL if the memory could not be allocated.

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.

◆ free

void( * jpeg_callbacks::free) (void *memory)

Free a block of memory previously allocated from the RIP.

Parameters
memoryA memory pointer previously returned by the jpeg_callbacks::alloc() call. After calling this function, the memory should not be dereferenced.

◆ size

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.

◆ source

HqBool( * jpeg_callbacks::source) (void *source_data, size_t *bytes_read, const uint8 **buffer)

Callback to read the underlying source.

Parameters
[in]source_dataThe opaque data source, as provided to the decompress_init() call.
[out]bytes_readA pointer to the number of bytes read from the source. If no data was read, this will be set to zero.
[out]bufferA pointer to the data buffer read from the source. If no data was read, this will be set to NULL.
Return values
TRUEIf the call read data from the image source.
FALSEIf there was no more data to read, or there was an error reading data from the image source.

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