Go to the source code of this file.
|
lzg_uint32_t | LZG_MaxEncodedSize (lzg_uint32_t insize) |
|
void | LZG_InitEncoderConfig (lzg_encoder_config_t *config) |
|
lzg_uint32_t | LZG_WorkMemSize (lzg_encoder_config_t *config) |
|
lzg_uint32_t | LZG_Encode (const unsigned char *in, lzg_uint32_t insize, unsigned char *out, lzg_uint32_t outsize, lzg_encoder_config_t *config) |
|
lzg_uint32_t | LZG_EncodeFull (const unsigned char *in, lzg_uint32_t insize, unsigned char *out, lzg_uint32_t outsize, lzg_encoder_config_t *config, void *workmem) |
|
lzg_uint32_t | LZG_DecodedSize (const unsigned char *in, lzg_uint32_t insize) |
|
lzg_uint32_t | LZG_Decode (const unsigned char *in, lzg_uint32_t insize, unsigned char *out, lzg_uint32_t outsize) |
|
lzg_uint32_t | LZG_Version (void) |
|
const char * | LZG_VersionString (void) |
|
◆ LZGPROGRESSFUN
typedef void(* LZGPROGRESSFUN) (lzg_int32_t progress, void *userdata) |
Progress callback function.
- Parameters
-
[in] | progress | The current progress (0-100). |
[in] | userdata | User supplied data pointer. |
◆ LZG_Decode()
Decode LZG coded data.
- Parameters
-
[in] | in | Input (compressed) buffer. |
[in] | insize | Size of the input buffer (number of bytes). |
[out] | out | Output (uncompressed) buffer. |
[in] | outsize | Size of the output buffer (number of bytes). |
- Returns
- The size of the decoded data, or zero if the function failed (e.g. if the end of the output buffer was reached before the entire input buffer was decoded).
◆ LZG_DecodedSize()
Determine the size of the decoded data for a given LZG coded buffer.
- Parameters
-
[in] | in | Input (compressed) buffer. |
[in] | insize | Size of the input buffer (number of bytes). This does not have to be the size of the entire compressed data, but it has to be at least 7 bytes (the first few bytes of the header, including the decompression size). |
- Returns
- The size of the decoded data, or zero if the function failed (e.g. if the magic header ID could not be found).
◆ LZG_Encode()
Encode uncompressed data using the LZG coder (i.e. compress the data).
- Parameters
-
[in] | in | Input (uncompressed) buffer. |
[in] | insize | Size of the input buffer (number of bytes). |
[out] | out | Output (compressed) buffer. |
[in] | outsize | Size of the output buffer (number of bytes). |
[in] | config | Compression configuration (if set to NULL, default encoder configuration parameters are used). |
- Returns
- The size of the encoded data, or zero if the function failed (e.g. if the end of the output buffer was reached before the entire input buffer was encoded).
- Note
- For the slow method (config->fast = 0), the memory requirement during compression is 136 KB (LZG_LEVEL_1) to 2 MB (LZG_LEVEL_9). For the fast method (config->fast = 1), the memory requirement is 64 MB (LZG_LEVEL_1) to 66 MB (LZG_LEVEL_9). Also note that these figures are doubled on 64-bit systems.
◆ LZG_EncodeFull()
Encode uncompressed data using the LZG coder (i.e. compress the data).
- Parameters
-
[in] | in | Input (uncompressed) buffer. |
[in] | insize | Size of the input buffer (number of bytes). |
[out] | out | Output (compressed) buffer. |
[in] | outsize | Size of the output buffer (number of bytes). |
[in] | config | Compression configuration (if set to NULL, default encoder configuration parameters are used). |
[in] | workmem | Buffer to be used for compression, or NULL. See LZG_WorkMemSize. |
- Returns
- The size of the encoded data, or zero if the function failed (e.g. if the end of the output buffer was reached before the entire input buffer was encoded).
- Note
- For the slow method (config->fast = 0), the memory requirement during compression is 136 KB (LZG_LEVEL_1) to 2 MB (LZG_LEVEL_9). For the fast method (config->fast = 1), the memory requirement is 64 MB (LZG_LEVEL_1) to 66 MB (LZG_LEVEL_9). Also note that these figures are doubled on 64-bit systems.
◆ LZG_InitEncoderConfig()
Initialize an encoder configuration object.
- Parameters
-
[out] | config | Configuration object. |
◆ LZG_MaxEncodedSize()
Determine the maximum size of the encoded data for a given uncompressed buffer.
- Parameters
-
[in] | insize | Size of the uncompressed buffer (number of bytes). |
- Returns
- Worst case (maximum) size of the encoded data.
◆ LZG_Version()
Get the version of the LZG library.
- Returns
- The version of the LZG library, on the same format as LZG_VERNUM.
◆ LZG_VersionString()
const char* LZG_VersionString |
( |
void |
| ) |
|
Get the version string of the LZG library.
- Returns
- The version of the LZG library, on the same format as LZG_VERSION.
◆ LZG_WorkMemSize()
Determine the amount of memory required for encoding.
- Parameters
-
[in] | config | Compression configuration (if set to NULL, default encoder configuration parameters are used). The size of the buffer required. |