Data compression More...
#include <LDM/compressors/SoDataCompressor.h>
Classes | |
struct | TileInfo |
This structure contains the dimension and the type of the tile being processed. More... | |
Public Member Functions | |
SoDataCompressor () | |
Constructor. | |
virtual | ~SoDataCompressor () |
Destructor. | |
virtual size_t | compress (void *src, size_t srcLen, const TileInfo &tileInfo)=0 |
Compresses the given buffer into the internal buffer. | |
virtual size_t | uncompress (void *dest, size_t destLen, const TileInfo &tileInfo)=0 |
Uncompresses data from the internal buffer to the given buffer. | |
virtual SbString | getCompressionFormatName () const =0 |
Returns the name of the compression algorithm used by this class. | |
virtual bool | isLossless ()=0 |
Returns true if the compression algorithm is lossless. | |
virtual void | setCompressionLevel (size_t level) |
Sets the compression level. | |
virtual void * | allocateCompressedBuffer (size_t size) |
Allocates the internal buffer to hold the compressed data. | |
virtual void * | getCompressedBuffer () |
Returns the compressed data. | |
virtual size_t | getCompressionLevel () |
Returns the compression level. | |
Public Member Functions inherited from SoTypedObject | |
virtual SoType | getTypeId () const =0 |
Returns the type identifier for a specific instance. | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoDataCompressor * | getAppropriateCompressor (const SbString &name) |
Create and return an instance of a compressor of the given type. | |
static SbStringList | getAvailableCompressors () |
Return a list of all available compressors. | |
static size_t | crc32 (const void *buf, size_t len) |
Utility function to get the CRC32 of a buffer. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
This is an abstract class which is only needed for advanced users who intend to add a new LDM data compression technique.
By implementing each virtual method of this class, it is possible to create a new compression algorithm. As with a custom node, the initClass of the custom compressor must be called before creating and instantiating an instance of the custom class. After you call initClass, the compression algorithm will be available in the '-c' option of SoConverter.
SoGzipDataCompressor, SoJpegDataCompressor
Definition at line 65 of file SoDataCompressor.h.
|
inline |
Constructor.
Definition at line 120 of file SoDataCompressor.h.
|
inlinevirtual |
Destructor.
Definition at line 124 of file SoDataCompressor.h.
|
inlinevirtual |
Allocates the internal buffer to hold the compressed data.
size | is the size to allocate in bytes. |
Definition at line 179 of file SoDataCompressor.h.
|
pure virtual |
Compresses the given buffer into the internal buffer.
src | a pointer to the data to compress. |
srcLen | the size of the source buffer in bytes. |
tileInfo | contains information about the tile being processed. |
Implemented in SoGzipDataCompressor, and SoJpegDataCompressor.
|
static |
Utility function to get the CRC32 of a buffer.
buf | a pointer to the data. |
len | the size of the buffer. |
|
static |
Create and return an instance of a compressor of the given type.
name | The name of the compressor. |
|
static |
Return a list of all available compressors.
|
inlinevirtual |
Returns the compressed data.
This pointer must not be deleted.
Definition at line 194 of file SoDataCompressor.h.
|
pure virtual |
Returns the name of the compression algorithm used by this class.
This is the name the user will pass to the "-c" option of the converter, so it should be something simple and clear.
Implemented in SoGzipDataCompressor, and SoJpegDataCompressor.
|
inlinevirtual |
Returns the compression level.
Definition at line 209 of file SoDataCompressor.h.
|
pure virtual |
Returns true if the compression algorithm is lossless.
Implemented in SoGzipDataCompressor, and SoJpegDataCompressor.
|
inlinevirtual |
Sets the compression level.
level | the level of the compression used. Valid compression levels are specific to the compression algorithm. |
Definition at line 172 of file SoDataCompressor.h.
|
pure virtual |
Uncompresses data from the internal buffer to the given buffer.
dest | a pointer to the destination buffer. |
destLen | the size of the destination buffer in bytes. |
tileInfo | contains information about the tile being processed. |
Implemented in SoGzipDataCompressor, and SoJpegDataCompressor.