SoDataCompressor Class Reference
[Compressor]

Large Data Management Data compression More...

#include <LDM/compressors/SoDataCompressor.h>

Inheritance diagram for SoDataCompressor:
SoTypedObject SoGzipDataCompressor SoJp3dDataCompressor SoJpegDataCompressor

List of all members.

Classes

struct  TileInfo
 This structure contains the dimension and the type of the tile being processed. More...

Public Member Functions

 SoDataCompressor ()
virtual ~SoDataCompressor ()
virtual size_t compress (void *src, size_t srcLen, const TileInfo &tileInfo)=0
virtual size_t uncompress (void *dest, size_t destLen, const TileInfo &tileInfo)=0
virtual SbString getCompressionFormatName () const =0
virtual bool isLossless ()=0
virtual void setCompressionLevel (size_t level)
virtual void * allocateCompressedBuffer (size_t size)
virtual void * getCompressedBuffer ()
virtual size_t getCompressionLevel ()

Static Public Member Functions

static SoDataCompressorgetAppropriateCompressor (const SbString &name)
static SbStringList getAvailableCompressors ()
static size_t crc32 (const void *buf, size_t len)

Detailed Description

Large Data Management Data compression

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.

SEE ALSO

SoGzipDataCompressor, SoJpegDataCompressor, SoJp3dDataCompressor


Constructor & Destructor Documentation

SoDataCompressor::SoDataCompressor (  )  [inline]

Constructor.

virtual SoDataCompressor::~SoDataCompressor (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual void* SoDataCompressor::allocateCompressedBuffer ( size_t  size  )  [inline, virtual]

Allocates the internal buffer to hold the compressed data.

Parameters:
size is the size to allocate in bytes.
virtual size_t SoDataCompressor::compress ( void *  src,
size_t  srcLen,
const TileInfo tileInfo 
) [pure virtual]

Compresses the given buffer into the internal buffer.

Parameters:
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.
Returns:
The size in bytes of the compressed buffer.

Implemented in SoGzipDataCompressor, SoJp3dDataCompressor, and SoJpegDataCompressor.

static size_t SoDataCompressor::crc32 ( const void *  buf,
size_t  len 
) [static]

Utility function to get the CRC32 of a buffer.

Parameters:
buf a pointer to the data.
len the size of the buffer.
Returns:
The CRC32 of the data.
static SoDataCompressor* SoDataCompressor::getAppropriateCompressor ( const SbString name  )  [static]

Create and return an instance of a compressor of the given type.

Parameters:
name The name of the compressor.
Returns:
A pointer to the newly created compressor. If this compressor is not available, returns NULL.
static SbStringList SoDataCompressor::getAvailableCompressors (  )  [static]

Return a list of all available compressors.

virtual void* SoDataCompressor::getCompressedBuffer (  )  [inline, virtual]

Returns the compressed data.

This pointer must not be deleted.

Returns:
A pointer to the compressed data.
virtual SbString SoDataCompressor::getCompressionFormatName (  )  const [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.

Returns:
A SbString containing the name of the compression.

Implemented in SoGzipDataCompressor, SoJp3dDataCompressor, and SoJpegDataCompressor.

virtual size_t SoDataCompressor::getCompressionLevel (  )  [inline, virtual]

Returns the compression level.

Returns:
The level of compression. See setCompressionLevel.
virtual bool SoDataCompressor::isLossless (  )  [pure virtual]

Returns true if the compression algorithm is lossless.

Warning:
It allows the converter to know if it must do CRC32 on original data or decompressed data when the '-C' option is enabled. Computing CRC32 on lossy compression is more costly than on lossless compression because data must be uncompressed before applying the CRC32 in order to have the real data stored in the file. Setting the environment variable LDM_COMPRESS_CHECK_CRC32 to 1 will force the LDM reader to check data integrity.
Returns:
True if the compression is lossless.

Implemented in SoGzipDataCompressor, SoJp3dDataCompressor, and SoJpegDataCompressor.

virtual void SoDataCompressor::setCompressionLevel ( size_t  level  )  [inline, virtual]

Sets the compression level.

Parameters:
level the level of the compression used. Valid compression levels are specific to the compression algorithm.
virtual size_t SoDataCompressor::uncompress ( void *  dest,
size_t  destLen,
const TileInfo tileInfo 
) [pure virtual]

Uncompresses data from the internal buffer to the given buffer.

Parameters:
dest a pointer to the destination buffer.
destLen the size of the destination buffer in bytes.
tileInfo contains information about the tile being processed.
Returns:
The number of uncompressed bytes.

Implemented in SoGzipDataCompressor, SoJp3dDataCompressor, and SoJpegDataCompressor.


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

Open Inventor Toolkit reference manual, generated on 18 Jul 2022
Copyright © Thermo Fisher Scientific All rights reserved.
http://www.openinventor.com/