Harlequin RIP SDK

The zlib API wrapper is an RDR-discoverable interface that provides access to the zlib library. More...

Files

file  zlibapi.h
 Header file defining the ZLIB interface API.
 
file  zlibrdr.h
 Functions to register and deregister the ZLIB API.
 

Data Structures

struct  sw_zlib_api_20200929
 Zlib API version 20200929 exposes basic compression, decompression, and checksum calls. More...
 

Macros

#define adler32   zlib_api->adler32
 Update an Adler-32 checksum with bytes from a buffer. More...
 
#define compressBound   zlib_api->compressBound
 Return an upper bound on the compressed size, assuming data is compressed in one step with the default compression level. More...
 
#define crc32   zlib_api->crc32
 Update a CRC-32 checksum with bytes from a buffer. More...
 
#define deflate   zlib_api->deflate
 Compress as much data as possible. More...
 
#define deflateEnd   zlib_api->deflateEnd
 Discard and destroy a compression stream. More...
 
#define deflateInit   zlib_api->deflateInit
 Initializes a stream for compression. More...
 
#define deflateInit2   zlib_api->deflateInit2
 Initializes a stream for compression with options. More...
 
#define deflateParams   zlib_api->deflateParams
 Change parameters on a compression stream. More...
 
#define deflateReset   zlib_api->deflateReset
 End and re-initialize a stream for compression. More...
 
#define inflate   zlib_api->inflate
 Decompress as much data as possible. More...
 
#define inflateInit   zlib_api->inflateInit
 Initializes a stream for decompression. More...
 
#define inflateInit2   zlib_api->inflateInit2
 Initializes a stream for decompression with options. More...
 
#define inflateEnd   zlib_api->inflateEnd
 Discard and destroy a decompression stream. More...
 
#define inflateReset   zlib_api->inflateReset
 End and re-initialize a stream for decompression. More...
 
#define inflateReset2   zlib_api->inflateReset2
 End and re-initialize a stream for decompression with options. More...
 
#define inflateSync   zlib_api->inflateSync
 Skips invalid compressed data until a possible point to resume decompression is reached. More...
 
#define inflateValidate   zlib_api->inflateValidate
 Check if a stream structure is consistent. More...
 

Detailed Description

The zlib API wrapper is an RDR-discoverable interface that provides access to the zlib library.

These calls are based on the zlib API, but not all calls in the zlib API are exposed through this API.

Data is compressed by calling deflateInit(), deflate() and then deflateEnd(). Data is decompressed by calling inflateInit(), inflate() and then inflateEnd().

CRCs may be computed and updated using either the Adler-32 method by calling adler32(), or CRC-32 method by calling crc32().

A zlib API pointer must be discovered using RDR using class RDR_CLASS_API and type RDR_API_ZLIB and assigned to a suitably-named API pointer variable before the API macros are used. The zlib API is automatically registered when the Harlequin RIP is started. It is deregistered when the Harlequin RIP is shutdown.

The Harlequin RIP SDK provides some utility functions that package zlib API calls in zlibutil.h.

Macro Definition Documentation

◆ adler32

#define adler32   zlib_api->adler32

Update an Adler-32 checksum with bytes from a buffer.

Parameters
[in]adlerChecksum to update.
[in]bufPointer to bytes to update checksum with.
[in]lenThe number of bytes in buf.
Returns
The updated checksum.

See the Zlib manual for more detail.

◆ compressBound

#define compressBound   zlib_api->compressBound

Return an upper bound on the compressed size, assuming data is compressed in one step with the default compression level.

Parameters
[in]sourceLenLength of input data
Returns
Upper bound of compressed size.

See the Zlib manual for more detail.

◆ crc32

#define crc32   zlib_api->crc32

Update a CRC-32 checksum with bytes from a buffer.

Parameters
[in]crcChecksum to update.
[in]bufPointer to bytes to update checksum with.
[in]lenThe number of bytes in buf.
Returns
The updated checksum.

See the Zlib manual for more detail.

◆ deflate

#define deflate   zlib_api->deflate

Compress as much data as possible.

Parameters
[in]strmThe stream to compress, taking up to avail_in bytes from the next_in location.
[in]flushOne of Z_NO_FLUSH, Z_SYNC_FLUSH, Z_PARTIAL_FLUSH, Z_BLOCK, Z_FULL_FLUSH or Z_FINISH.
Return values
Z_OKif progress was made
Z_STREAM_ENDif all input has been consumed and all output produced
Z_BUF_ERRORif no progress was possible
Z_STREAM_ERRORif the stream state was inconsistent

See the Zlib manual for more detail.

◆ deflateEnd

#define deflateEnd   zlib_api->deflateEnd

Discard and destroy a compression stream.

Parameters
[in]strmThe stream to destroy.
Return values
Z_OKon success
Z_DATA_ERRORif the stream was destroyed with input pending or output unprocessed
Z_STREAM_ERRORif the stream state was inconsistent

See the Zlib manual for more detail.

◆ deflateInit

#define deflateInit   zlib_api->deflateInit

Initializes a stream for compression.

Parameters
[in]strmThe stream to compress. The zalloc, zfree and opaque fields must be initialized by the caller. Global Graphics recommends setting the zalloc and zfree fields to allocator and deallocator functions that use memory from the RIP or skin's MPS pools. The SwAlloc() and SwFree() functions allocate and free memory from the core RIP's pools. The MemAlloc() and MemFree() functions allocate and free memory from the SDK's pools.
[in]levelThe compression level, from 0 (no compression) to 9 (best compression). Z_DEFAULT_COMPRESSION uses a compromise between speed and size.
Return values
Z_OKon success
Z_MEM_ERRORif memory allocation failed
Z_STREAM_ERRORif the compression level is invalid
Z_VERSION_ERRORif the library version is incompatible with the version assumed by the caller.

See the Zlib manual for more detail.

◆ deflateInit2

#define deflateInit2   zlib_api->deflateInit2

Initializes a stream for compression with options.

Parameters
[in]strmThe stream to compress. The zalloc, zfree and opaque fields must be initialized by the caller. Global Graphics recommends setting the zalloc and zfree fields to allocator and deallocator functions that use memory from the RIP or skin's MPS pools. The SwAlloc() and SwFree() functions allocate and free memory from the core RIP's pools. The MemAlloc() and MemFree() functions allocate and free memory from the SDK's pools.
[in]levelThe compression level, from 0 (no compression) to 9 (best compression). Z_DEFAULT_COMPRESSION uses a compromise between speed and size.
[in]methodThis must be Z_DEFLATED.
[in]windowBitsBase 2 logarithm of the size of the compression history buffer, in the range 8-15.
[in]memLevelHow much memory should be allocated for internal compression state, from 1 (minimum) to 9 (maximum).
[in]strategyOne of Z_DEFAULT_STRATEGY; Z_FILTERED; Z_HUFFMAN_ONLY, or Z_RLE.
Return values
Z_OKon success
Z_MEM_ERRORif memory allocation failed
Z_STREAM_ERRORif the compression level is invalid
Z_VERSION_ERRORif the library version is incompatible with the version assumed by the caller.
Note
The Harlequin RIP and SDK do not use this call directly, but LibPNG may do.

See the Zlib manual for more detail.

◆ deflateParams

#define deflateParams   zlib_api->deflateParams

Change parameters on a compression stream.

Parameters
[in]strmThe stream to change parameters on.
[in]levelThe compression level, from 0 (no compression) to 9 (best compression). Z_DEFAULT_COMPRESSION uses a compromise between speed and size.
[in]strategyOne of Z_DEFAULT_STRATEGY; Z_FILTERED; Z_HUFFMAN_ONLY, or Z_RLE.
Return values
Z_OKon success
Z_STREAM_ERRORif the stream state was inconsistent
Note
The Harlequin RIP and SDK do not use this call directly. The TIFF library used for raster output in the "clrip" application layer may use this call.

See the Zlib manual for more detail.

◆ deflateReset

#define deflateReset   zlib_api->deflateReset

End and re-initialize a stream for compression.

This call is equivalent to deflateEnd() followed by deflateInit(), but does not free and reallocate the internal compression state or parameters.

Parameters
[in]strmThe stream to reset.
Return values
Z_OKon success
Z_STREAM_ERRORif the stream state was inconsistent
Note
The Harlequin core RIP does not use this call directly. The Harlequin SDK utility function gg_compress() uses this call, and the TIFF library used for raster output in the "clrip" application layer may also use this call.

See the Zlib manual for more detail.

◆ inflate

#define inflate   zlib_api->inflate

Decompress as much data as possible.

Parameters
[in]strmThe stream to decompress.
[in]flushOne of Z_NO_FLUSH, Z_SYNC_FLUSH, Z_BLOCK, Z_TREES or Z_FINISH.
Return values
Z_OKif progress was made
Z_STREAM_ENDif the end of the compressed data has been reached and all uncompressed output has been produced
Z_BUF_ERRORif no progress was possible
Z_MEM_ERRORif memory allocation failed
Z_STREAM_ERRORif the stream state was inconsistent

See the Zlib manual for more detail.

◆ inflateEnd

#define inflateEnd   zlib_api->inflateEnd

Discard and destroy a decompression stream.

Parameters
[in]strmThe stream to destroy.
Return values
Z_OKon success
Z_STREAM_ERRORif the stream state was inconsistent

See the Zlib manual for more detail.

◆ inflateInit

#define inflateInit   zlib_api->inflateInit

Initializes a stream for decompression.

Parameters
[in]strmThe stream to decompress. The next_in, avail_in, zalloc, zfree and opaque fields must be initialized by the caller. Global Graphics recommends setting the zalloc and zfree fields to allocator and deallocator functions that use memory from the RIP or skin's MPS pools. The SwAlloc() and SwFree() functions allocate and free memory from the core RIP's pools. The MemAlloc() and MemFree() functions allocate and free memory from the SDK's pools.
Return values
Z_OKon success
Z_MEM_ERRORif memory allocation failed
Z_VERSION_ERRORif the library version is incompatible with the version assumed by the caller.

See the Zlib manual for more detail.

◆ inflateInit2

#define inflateInit2   zlib_api->inflateInit2

Initializes a stream for decompression with options.

Parameters
[in]strmThe stream to decompress. The next_in, avail_in, zalloc, zfree and opaque fields must be initialized by the caller. Global Graphics recommends setting the zalloc and zfree fields to allocator and deallocator functions that use memory from the RIP or skin's MPS pools. The SwAlloc() and SwFree() functions allocate and free memory from the core RIP's pools. The MemAlloc() and MemFree() functions allocate and free memory from the SDK's pools.
[in]windowBitsBase 2 logarithm of the size of the compression history buffer, in the range 8-15, or 0 to use the value in the compressed stream.
Return values
Z_OKon success
Z_MEM_ERRORif memory allocation failed
Z_STREAM_ERRORif the parameters are invalid
Z_VERSION_ERRORif the library version is incompatible with the version assumed by the caller.
Note
The Harlequin RIP and SDK do not use this call directly, but LibPNG may do.

See the Zlib manual for more detail.

◆ inflateReset

#define inflateReset   zlib_api->inflateReset

End and re-initialize a stream for decompression.

This call is equivalent to inflateEnd() followed by inflateInit(), but does not free and reallocate the internal decompression state or parameters.

Parameters
[in]strmThe stream to reset.
Return values
Z_OKon success
Z_STREAM_ERRORif the stream state was inconsistent
Note
The Harlequin RIP and SDK do not use this call directly, but LibPNG may do. The TIFF library used for raster output in the "clrip" application layer may also use this call.

See the Zlib manual for more detail.

◆ inflateReset2

#define inflateReset2   zlib_api->inflateReset2

End and re-initialize a stream for decompression with options.

This call is equivalent to inflateEnd() followed by inflateInit(), but does not free and reallocate the internal decompression state or parameters.

Parameters
[in]strmThe stream to reset.
[in]windowBitsBase 2 logarithm of the size of the compression history buffer, in the range 8-15, or 0 to use the value in the compressed stream.
Return values
Z_OKon success
Z_STREAM_ERRORif the stream state was inconsistent or the windowBits parameter was invalid.
Note
The Harlequin RIP and SDK do not use this call directly, but LibPNG may do.

See the Zlib manual for more detail.

◆ inflateSync

#define inflateSync   zlib_api->inflateSync

Skips invalid compressed data until a possible point to resume decompression is reached.

Parameters
[in]strmThe stream to resynchronize.
Return values
Z_OKif a possible resumption point was found
Z_BUF_ERRORif no more input was provided
Z_DATA_ERRORif no resumption point was found
Z_STREAM_ERRORif stream structure was inconsistent
Note
The Harlequin RIP and SDK do not use this call directly. The TIFF library used for raster output in the "clrip" application layer may use this call.

See the Zlib manual for more detail.

◆ inflateValidate

#define inflateValidate   zlib_api->inflateValidate

Check if a stream structure is consistent.

Parameters
[in]strmThe stream to validate.
[in]checkA boolean indicating whether to set or unset the stream's validation mark.
Return values
Z_OKon success
Z_STREAM_ERRORif stream structure was inconsistent