#include <cel_compress.h>
Public Types | |
| enum | { levelDefault = -1 } |
Static Public Member Functions | |
| static void | compress (SimpleArray< u8 > &outBuffer, const u8 *CEL_RESTRICT inData, size_t inSize, int compLevel=levelDefault) |
| static void | compress (u8 *CEL_RESTRICT outBuffer, size_t *CEL_RESTRICT ioSize, const u8 *CEL_RESTRICT inData, size_t inSize, int compLevel=levelDefault) |
| static void | decompress (SimpleArray< u8 > &outBuffer, const u8 *CEL_RESTRICT inData, size_t inSize) |
| static void | decompress (u8 *CEL_RESTRICT outBuffer, size_t *ioSize, const u8 *CEL_RESTRICT inData, size_t inSize) |
| static u32 | adler32 (u32 inCurrentAdler, const u8 *CEL_RESTRICT inData, size_t inSize) |
| static u32 | crc32 (u32 inCurrentCRC, const u8 *CEL_RESTRICT inData, size_t inSize) |
Definition at line 20 of file cel_compress.h.
| anonymous enum |
| levelDefault | compression level default; used with compress function. |
Definition at line 22 of file cel_compress.h.
| static void Celartem::Zlib::compress | ( | SimpleArray< u8 > & | outBuffer, | |
| const u8 *CEL_RESTRICT | inData, | |||
| size_t | inSize, | |||
| int | compLevel = levelDefault | |||
| ) | [static] |
This function compresses the specified data using zlib.
| outBuffer | A buffer to receive the compressed result. | |
| inData | Pointer that points the data to be compressed. | |
| inSize | The size of the data specified by inData. | |
| compLevel | Compression level in 1-9. Smaller number means faster but low-compression ratio. levelDefault currently stands for 6. |
| static void Celartem::Zlib::compress | ( | u8 *CEL_RESTRICT | outBuffer, | |
| size_t *CEL_RESTRICT | ioSize, | |||
| const u8 *CEL_RESTRICT | inData, | |||
| size_t | inSize, | |||
| int | compLevel = levelDefault | |||
| ) | [static] |
This function compresses the specified data using zlib.
| outBuffer | A buffer to receive the compressed result. | |
| ioSize | [IN] The size of the buffer specified by outBuffer. [OUT] The bytes written on the outBuffer. | |
| inData | Pointer that points the data to be compressed. | |
| inSize | The size of the data specified by inData. | |
| compLevel | Compression level in 1-9. Smaller number means faster but low-compression ratio. levelDefault currently stands for 6. |
| static void Celartem::Zlib::decompress | ( | SimpleArray< u8 > & | outBuffer, | |
| const u8 *CEL_RESTRICT | inData, | |||
| size_t | inSize | |||
| ) | [static] |
This function decompresses the specified data using zlib.
| outBuffer | A buffer to receive the decompressed result. This buffer must be large enough to receive the decompressed result. | |
| inData | Pointer that points the data to be decompressed. | |
| inSize | The size of the data specified by inData. |
| static void Celartem::Zlib::decompress | ( | u8 *CEL_RESTRICT | outBuffer, | |
| size_t * | ioSize, | |||
| const u8 *CEL_RESTRICT | inData, | |||
| size_t | inSize | |||
| ) | [static] |
This function decompresses the specified data using zlib.
| outBuffer | The buffer to receive the decompressed result. | |
| ioSize | [IN] The size of the buffer specified by outBuffer. [OUT] The bytes written on the outBuffer. | |
| inData | Pointer that points the data to be decompressed. | |
| inSize | The size of the data specified by inData. |
| static u32 Celartem::Zlib::adler32 | ( | u32 | inCurrentAdler, | |
| const u8 *CEL_RESTRICT | inData, | |||
| size_t | inSize | |||
| ) | [static] |
This function updates zlib origin Adler-32 checksum.
If inData is NULL, this funcion returnes the initial value for the checksum.
| inCurrentCRC | Current checksum value. | |
| inData | ||
| inData | Pointer that points the data to be verified. | |
| inSize | The size of the data specified by inData. |
u32 crc = Zlib::adler32(0, NULL, 0); while(...) { crc = Zlib::adler32(crc, buffer, length); } if(crc != original_crc) error();
| static u32 Celartem::Zlib::crc32 | ( | u32 | inCurrentCRC, | |
| const u8 *CEL_RESTRICT | inData, | |||
| size_t | inSize | |||
| ) | [static] |
This function updates CRC32 checksum.
If inData is NULL, this funcion returnes the initial value for the checksum.
| inCurrentCRC | Current checksum value. | |
| inData | ||
| inData | Pointer that points the data to be verified. | |
| inSize | The size of the data specified by inData. |
u32 crc = Zlib::crc32(0, NULL, 0); while(...) { crc = Zlib::crc32(crc, buffer, length); } if(crc != original_crc) error();