25#ifndef SO_DATA_COMPRESSOR_H
26#define SO_DATA_COMPRESSOR_H
29#pragma warning( push )
30#pragma warning(disable:4251)
33#include <Inventor/SoSubTypedClass.h>
34#include <Inventor/sys/port.h>
35#include <Inventor/SbString.h>
36#include <Inventor/lists/SbStringList.h>
37#include <Inventor/SbLinear.h>
38#include <Inventor/SbDataType.h>
39#include <Inventor/STL/vector>
41#include <LDM/nodes/SoDataSet.h>
67 SO_TYPED_CLASS_ABSTRACT_HEADER()
182 m_compressedBuffer.resize(size);
184 return &m_compressedBuffer[0];
203 static size_t crc32(
const void *buf,
size_t len);
213 size_t getSize() {
return m_size;};
219 std::vector<unsigned char> m_compressedBuffer;
225#pragma warning( pop )
Class encoding a data type.
Class for smart character strings.
Maintains a list of pointers to SbString instances.
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> 2D vector class ...
<a href="IconLegend.html"><img src="extLDM.gif" alt="Large Data Management" border="0"></a> Data com...
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 SoDataCompressor * getAppropriateCompressor(const SbString &name)
Create and return an instance of a compressor of the given type.
virtual void * getCompressedBuffer()
Returns the compressed data.
virtual bool isLossless()=0
Returns true if the compression algorithm is lossless.
virtual ~SoDataCompressor()
Destructor.
SoDataCompressor()
Constructor.
virtual void * allocateCompressedBuffer(size_t size)
Allocates the internal buffer to hold the compressed data.
virtual void setCompressionLevel(size_t level)
Sets the compression level.
virtual size_t uncompress(void *dest, size_t destLen, const TileInfo &tileInfo)=0
Uncompresses data from the internal buffer to the given buffer.
virtual size_t compress(void *src, size_t srcLen, const TileInfo &tileInfo)=0
Compresses the given buffer into the internal buffer.
virtual SbString getCompressionFormatName() const =0
Returns the name of the compression algorithm used by this class.
virtual size_t getCompressionLevel()
Returns the compression level.
DataType
Supported data type.
Base class for object storing runtime type information.
This structure contains the dimension and the type of the tile being processed.
SbVec3i32 dims
Dimensions of the tile.
SbVec2d range
Data range of the tile's volume.
TileInfo(const SbVec3i32 &dims, const SbDataType &dataType)
TileInfo(const SbVec3i32 &dims, const SbDataType &dataType, const SbVec2d &range)
SoDataSet::DataType dataType
Tile's data type (byte, int, etc.).
bool isRGBA
True if tile data is a RGBA color packed in a 32bits integer.