The zlib API wrapper is an RDR-discoverable interface that provides access to the zlib library.
More...
|
#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...
|
|
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.
◆ adler32
#define adler32 zlib_api->adler32 |
Update an Adler-32 checksum with bytes from a buffer.
- Parameters
-
[in] | adler | Checksum to update. |
[in] | buf | Pointer to bytes to update checksum with. |
[in] | len | The 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] | sourceLen | Length 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] | crc | Checksum to update. |
[in] | buf | Pointer to bytes to update checksum with. |
[in] | len | The 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] | strm | The stream to compress, taking up to avail_in bytes from the next_in location. |
[in] | flush | One of Z_NO_FLUSH , Z_SYNC_FLUSH , Z_PARTIAL_FLUSH , Z_BLOCK , Z_FULL_FLUSH or Z_FINISH . |
- Return values
-
Z_OK | if progress was made |
Z_STREAM_END | if all input has been consumed and all output produced |
Z_BUF_ERROR | if no progress was possible |
Z_STREAM_ERROR | if 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] | strm | The stream to destroy. |
- Return values
-
Z_OK | on success |
Z_DATA_ERROR | if the stream was destroyed with input pending or output unprocessed |
Z_STREAM_ERROR | if 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] | strm | The 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] | level | The compression level, from 0 (no compression) to 9 (best compression). Z_DEFAULT_COMPRESSION uses a compromise between speed and size. |
- Return values
-
Z_OK | on success |
Z_MEM_ERROR | if memory allocation failed |
Z_STREAM_ERROR | if the compression level is invalid |
Z_VERSION_ERROR | if 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] | strm | The 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] | level | The compression level, from 0 (no compression) to 9 (best compression). Z_DEFAULT_COMPRESSION uses a compromise between speed and size. |
[in] | method | This must be Z_DEFLATED . |
[in] | windowBits | Base 2 logarithm of the size of the compression history buffer, in the range 8-15. |
[in] | memLevel | How much memory should be allocated for internal compression state, from 1 (minimum) to 9 (maximum). |
[in] | strategy | One of Z_DEFAULT_STRATEGY ; Z_FILTERED ; Z_HUFFMAN_ONLY , or Z_RLE . |
- Return values
-
Z_OK | on success |
Z_MEM_ERROR | if memory allocation failed |
Z_STREAM_ERROR | if the compression level is invalid |
Z_VERSION_ERROR | if 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] | strm | The stream to change parameters on. |
[in] | level | The compression level, from 0 (no compression) to 9 (best compression). Z_DEFAULT_COMPRESSION uses a compromise between speed and size. |
[in] | strategy | One of Z_DEFAULT_STRATEGY ; Z_FILTERED ; Z_HUFFMAN_ONLY , or Z_RLE . |
- Return values
-
Z_OK | on success |
Z_STREAM_ERROR | if 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] | strm | The stream to reset. |
- Return values
-
Z_OK | on success |
Z_STREAM_ERROR | if 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] | strm | The stream to decompress. |
[in] | flush | One of Z_NO_FLUSH , Z_SYNC_FLUSH , Z_BLOCK , Z_TREES or Z_FINISH . |
- Return values
-
Z_OK | if progress was made |
Z_STREAM_END | if the end of the compressed data has been reached and all uncompressed output has been produced |
Z_BUF_ERROR | if no progress was possible |
Z_MEM_ERROR | if memory allocation failed |
Z_STREAM_ERROR | if 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] | strm | The stream to destroy. |
- Return values
-
Z_OK | on success |
Z_STREAM_ERROR | if 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] | strm | The 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_OK | on success |
Z_MEM_ERROR | if memory allocation failed |
Z_VERSION_ERROR | if 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] | strm | The 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] | windowBits | Base 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_OK | on success |
Z_MEM_ERROR | if memory allocation failed |
Z_STREAM_ERROR | if the parameters are invalid |
Z_VERSION_ERROR | if 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] | strm | The stream to reset. |
- Return values
-
Z_OK | on success |
Z_STREAM_ERROR | if 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] | strm | The stream to reset. |
[in] | windowBits | Base 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_OK | on success |
Z_STREAM_ERROR | if 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] | strm | The stream to resynchronize. |
- Return values
-
Z_OK | if a possible resumption point was found |
Z_BUF_ERROR | if no more input was provided |
Z_DATA_ERROR | if no resumption point was found |
Z_STREAM_ERROR | if 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] | strm | The stream to validate. |
[in] | check | A boolean indicating whether to set or unset the stream's validation mark. |
- Return values
-
Z_OK | on success |
Z_STREAM_ERROR | if stream structure was inconsistent |