Harlequin RIP SDK
JPEG integration API

API to integrate external JPEG readers. More...

Files

file  jpegapi.h
 Header file defining the JPEG integration API.
 

Data Structures

struct  jpeg_decode_error
 Structure defining a JPEG decoding error detail passed to the error callback jpeg_callbacks::onerror(). More...
 
struct  jpeg_decode_warning
 Structure defining JPEG decoding warning messages passed to the warnings callback jpeg_callbacks::onwarning(). More...
 
struct  jpeg_callbacks
 Callback structure provided by the RIP to the JPEG implementation, for access to RIP memory handling and JPEG data source. More...
 
struct  jpeg_decode_params
 Structure defining any decode parameters defined for decoding the jpeg image. More...
 
struct  sw_jpeg_api_20190717
 JPEG api structure version 20190717. More...
 

Macros

#define JPEG_DECODE_ERROR_INIT   { sizeof(struct jpeg_decode_error), LJPEG_NOERROR, '\0' }
 Static/auto initialiser for empty jpeg_decode_error structure.
 
#define JPEG_DECODE_WARNING_INIT   { sizeof(struct jpeg_decode_warning), LJPEG_NOWARNING, '\0' }
 Static/auto initialiser for empty jpeg_decode_warning structure.
 
#define JPEG_CALLBACKS_INIT   { sizeof(jpeg_callbacks), NULL, NULL, NULL, NULL, NULL }
 Static/auto initialiser for empty jpeg_callbacks structure.
 

Typedefs

typedef struct jpeg_decode_error jpeg_decode_error
 Structure defining a JPEG decoding error detail passed to the error callback jpeg_callbacks::onerror(). More...
 
typedef struct jpeg_decode_warning jpeg_decode_warning
 Structure defining JPEG decoding warning messages passed to the warnings callback jpeg_callbacks::onwarning(). More...
 
typedef struct jpeg_callbacks jpeg_callbacks
 Callback structure provided by the RIP to the JPEG implementation, for access to RIP memory handling and JPEG data source. More...
 
typedef struct jpeg_decode_params jpeg_decode_params
 Structure defining any decode parameters defined for decoding the jpeg image. More...
 

Enumerations

enum  LJPEG_ERROR_CODE {
  LJPEG_NOERROR , LJPEG_EPARAMS , LJPEG_ESOURCE , LJPEG_EMEMORY ,
  LJPEG_EDECODER , LJPEG_EBUFFER , LJPEG_NUM_ERROR_CODES
}
 Enumeration of error codes from the JPEG API. More...
 
enum  LJPEG_WARNING_CODE { LJPEG_NOWARNING , LJPEG_WTRUNCATED , LJPEG_WDECODER , LJPEG_NUM_WARNING_CODES }
 Enumeration of warning codes from the JPEG API. More...
 

Detailed Description

API to integrate external JPEG readers.

This API is used by the Harlequin Core RIP when integrating platform-specific optimised JPEG decompression libraries. If the RIP skin registers an implementation of this API in RDR using class RDR_CLASS_API and type RDR_API_JPEG, and the /AlternateJPEGImplementations userparam is true, then the Core RIP will use the API to decode JPEG image data.

When an external JPEG reader is registered and configured, the core RIP will call the sw_jpeg_api_20190717::decompress_init() method before all other methods. If this succeeds, then the RIP will call sw_jpeg_api_20190717::decompress_read() multiple times to read data from the JPEG decoder. When this method either indicates an error, or indicates that no bytes were available, the RIP will call sw_jpeg_api_20190717::unconsumed_byte_count() to get the number of bytes in the buffer provided that the decoder did not consume. Finally, the RIP will call sw_jpeg_api_20190717::decompress_close() to clean up any allocations. This is called regardless of errors in the read method.

Clients of the JPEG reader can supply callbacks to allow the implementation to report errors and warnings encountered in any call to the JPEG API.

The core RIP registers an implementation of the JPEG API on startup that uses LibJPEG to decompress JPEG images using the LibJPEG integration API. Both libjpeg and libjpeg-turbo are integrated using this method. You may override this registration to use your own JPEG decompression code, or override the registration of the LibJPEG API to use a different version of LibJPEG. The JPEG integration API is deregistered when the core RIP is shutdown.

Typedef Documentation

◆ jpeg_callbacks

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.

◆ jpeg_decode_error

Structure defining a JPEG decoding error detail passed to the error callback jpeg_callbacks::onerror().

The JPEG implementation may report multiple decoding errors before the JPEG API call returns with an error indicator. It is up to the client how it will handle multiple errors from a single JPEG API call.

◆ jpeg_decode_params

Structure defining any decode parameters defined for decoding the jpeg image.

The JPEG implementation should copy the parameters provided in this structure into its own memory if needed for decoding.

◆ jpeg_decode_warning

Structure defining JPEG decoding warning messages passed to the warnings callback jpeg_callbacks::onwarning().

The JPEG implementation may report a warning message during decoding. This will happen when an inconsistency in the image data is detected but the decoder can continue processing. The output may be different to that expected when a warning is reported.

Enumeration Type Documentation

◆ LJPEG_ERROR_CODE

Enumeration of error codes from the JPEG API.

Enumerator
LJPEG_NOERROR 

No error.

LJPEG_EPARAMS 

Missing expected decode parameters.

LJPEG_ESOURCE 

Missing JPEG image data source callback.

LJPEG_EMEMORY 

Memory allocation failed.

LJPEG_EDECODER 

Error in JPEG image data decoding.

LJPEG_EBUFFER 

Invalid decoder size based on JPEG image data.

LJPEG_NUM_ERROR_CODES 

Total number of error codes in the JPEG API.

◆ LJPEG_WARNING_CODE

Enumeration of warning codes from the JPEG API.

Enumerator
LJPEG_NOWARNING 

No warning.

LJPEG_WTRUNCATED 

JPEG image data stream is prematurely ended.

LJPEG_WDECODER 

Warning from JPEG image decoder.

LJPEG_NUM_WARNING_CODES 

Total number of warning codes in the JPEG API.