Public Types | Static Public Member Functions | List of all members
Celartem::Zlib Struct Reference

#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)
 

Detailed Description

Compression/Decompression using zlib.

Member Enumeration Documentation

anonymous enum
Enumerator
levelDefault 

compression level default; used with compress function.

Member Function Documentation

static u32 Celartem::Zlib::adler32 ( u32  inCurrentAdler,
const u8 *CEL_RESTRICT  inData,
size_t  inSize 
)
static
        This function updates zlib origin Adler-32 checksum.\n
        If \a inData is \c NULL, this funcion returnes the initial value
        for the checksum.
        \param inCurrentCRC
            Current checksum value.
        \param inData
            \param inData
            Pointer that points the data to be verified.
        \param inSize
            The size of the data specified by \a inData.

        The following code is a sample usage of this function:
u32 crc = Zlib::adler32(0, NULL, 0);
while(...)
{
crc = Zlib::adler32(crc, buffer, length);
}
if(crc != original_crc) error();
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.

Parameters
outBufferA buffer to receive the compressed result.
inDataPointer that points the data to be compressed.
inSizeThe size of the data specified by inData.
compLevelCompression 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.

Parameters
outBufferA buffer to receive the compressed result.
ioSize[IN] The size of the buffer specified by outBuffer.
[OUT] The bytes written on the outBuffer.
inDataPointer that points the data to be compressed.
inSizeThe size of the data specified by inData.
compLevelCompression level in 1-9. Smaller number means faster but low-compression ratio. levelDefault currently stands for 6.
static u32 Celartem::Zlib::crc32 ( u32  inCurrentCRC,
const u8 *CEL_RESTRICT  inData,
size_t  inSize 
)
static
        This function updates CRC32 checksum.\n
        If \a inData is \c NULL, this funcion returnes the initial value
        for the checksum.
        \param inCurrentCRC
            Current checksum value.
        \param inData
            \param inData
            Pointer that points the data to be verified.
        \param inSize
            The size of the data specified by \a inData.

        The following code is a sample usage of this function:
u32 crc = Zlib::crc32(0, NULL, 0);
while(...)
{
crc = Zlib::crc32(crc, buffer, length);
}
if(crc != original_crc) error();
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.

Parameters
outBufferA buffer to receive the decompressed result. This buffer must be large enough to receive the decompressed result.
inDataPointer that points the data to be decompressed.
inSizeThe 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.

Parameters
outBufferThe buffer to receive the decompressed result.
ioSize[IN] The size of the buffer specified by outBuffer. [OUT] The bytes written on the outBuffer.
inDataPointer that points the data to be decompressed.
inSizeThe size of the data specified by inData.

The documentation for this struct was generated from the following file:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:06.
Cuminas Logo