Index

C/C++ Functions

fxBufferCompress

DT_SWORD fxBufferCompress(DT_AUX_INFO* info, DT_UBYTE* compr_addr, DT_SLONG* compr_len, const DT_UBYTE* raw_addr, DT_SLONG raw_len, DT_ID_SWORD level)

Short Description: Compress data in buffer

This function attempts to compress raw_len bytes of data in the buffer pointed by raw_addr, placing the result in the buffer pointed by compr_addr. The data compression format is specified by the FileFormat member variable of the info structure.

Parameters

ParameterDescription

info

Pointer to the DT_AUX_INFO structure containing the applicable initialization parameters.

compr_addr

A valid pointer to a user-supplied buffer to which the function will compress the data.

compr_len

On entry, compr_len points to a value describing the size of the buffer to which the function will compress the data, in bytes. The required buffer size can be obtained by calling fxBufferGetBound. On exit, this value will be updated to hold the actual length of the compressed data, in bytes.

raw_addr

A valid pointer to a buffer that holds uncompressed (raw) data.

raw_len

Size of the uncompressed (raw) data, in bytes.

level

Desired compression level. A value between 0 and 9, or the value -1. The value 0 indicates that no compression should be used, and the output shall be the same as the input. The value 1 requests the highest speed, while the value 9 requests the highest compression. The special value -1 means "default compression level" and is intended to be a good compromise between speed and compression effectiveness.

Return Value

The function returns 1 if successful and 0 otherwise.

 

Index