CXGetCompressionType

Syntax

#include <revolution/cx.h>

CXCompressionType CXGetCompressionType( const void* srcp );

Arguments

srcp Source address where the compressed data is stored.

Return Values

The compression format.

Description

This function obtains the compression format by checking the data header information of the compressed data. This function does not check the contents of the compressed data but only reads the compression format included in the beginning of the data.

It is compatible with all compression formats supported by the CX library.

The return values are enumerated type CXCompressType and have the following meanings:

CX_COMPRESSION_RL Data compressed using the run-length compression format.
CX_COMPRESSION_LZ Data compressed using the LZ77-extended or LZ77 compression format.
CX_COMPRESSION_HUFFMAN Data compressed using the Huffman format.
CX_COMPRESSION_LH Data compressed using the LH format.
CX_COMPRESSION_LRC Data compressed using the LRC format.
CX_COMPRESSION_DIFF Data compressed with an applied difference filter.

Internal Operation

Determines the compression type by reading the value of the data header's first byte.

See Also

CXUncompressLZ, CXUncompressHuffman, CXUncompressRL, CXUnfilterDiff, CXGetUncompressedSize

Revision History

2007/09/03 Changed from 4 to 1 the number of bytes needed to determine the compression format.
2006/07/06 Initial version.


CONFIDENTIAL