Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoJp3dDataCompressor Class Reference

Large Data Management JP3D data compression More...

#include <LDM/compressors/SoJp3dDataCompressor.h>

+ Inheritance diagram for SoJp3dDataCompressor:

Public Member Functions

 SoJp3dDataCompressor ()
 Constructor.
 
virtual ~SoJp3dDataCompressor ()
 Destructor.
 
virtual SbString getCompressionFormatName () const
 Returns the name of the compression algorithm used by this class.
 
virtual bool isLossless ()
 Checks if the compression is lossless.
 
virtual size_t compress (void *src, size_t srcLen, const TileInfo &tileInfo)
 Compresses the given buffer into the internal buffer.
 
virtual size_t uncompress (void *dst, size_t dstLen, const TileInfo &tileInfo)
 Uncompresses data from the internal buffer to the given buffer.
 
- Public Member Functions inherited from SoDataCompressor
 SoDataCompressor ()
 Constructor.
 
virtual ~SoDataCompressor ()
 Destructor.
 
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.
 

Additional Inherited Members

- Static Public Member Functions inherited from SoDataCompressor
static SoDataCompressorgetAppropriateCompressor (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.
 

Detailed Description

Large Data Management JP3D data compression

This class implements a wavelet compression scheme based on JP3D compression, an extension of the standard JPEG2000 algorithms specifically designed for volume data. It supports lossless and lossy compression. This is controlled by setCompressionLevel (see SoDataCompressor or SoConvertedParameters). A compression level of 0 specifies the lossless mode. Any other value specifies the target PSNR (Peak Signal to Noise Ratio).

Typical values for compression level (PSNR):

  • 0 specifies lossless mode.
  • 70 stands for "near lossless" mode (~0.03% error). Most of the volume will be encoded losslessly, but some parts will be encoded with a little error.
  • 40 is the "visually lossless" mode (~1% error). Some error will be introduced, but visually the volume will appear the same.

Limitations:

  • The maximum precision supported is 16 bits.
    Data values larger than 16 bits, for example float or 32 bit integer, will be converted to 16 bit integers, potentially making the compression lossy.

SEE ALSO

SoGzipDataCompressor, SoJpegDataCompressor, SoDataCompressor, SoConverterParameters

Definition at line 62 of file SoJp3dDataCompressor.h.

Constructor & Destructor Documentation

◆ SoJp3dDataCompressor()

SoJp3dDataCompressor::SoJp3dDataCompressor ( )

Constructor.

◆ ~SoJp3dDataCompressor()

virtual SoJp3dDataCompressor::~SoJp3dDataCompressor ( )
virtual

Destructor.

Member Function Documentation

◆ compress()

virtual size_t SoJp3dDataCompressor::compress ( void *  src,
size_t  srcLen,
const TileInfo tileInfo 
)
virtual

Compresses the given buffer into the internal buffer.

Parameters
srca pointer to the data to compress.
srcLenthe size of the source buffer in bytes.
tileInfocontains information about the tile being processed.
Returns
The size in bytes of the compressed buffer.

Implements SoDataCompressor.

◆ getCompressionFormatName()

virtual SbString SoJp3dDataCompressor::getCompressionFormatName ( ) const
virtual

Returns the name of the compression algorithm used by this class.

This is the name the user must pass to the "-c" option of the converter to use this compression ("jp3d" here).

Returns
An SbString containing "jp3d".

Implements SoDataCompressor.

◆ isLossless()

virtual bool SoJp3dDataCompressor::isLossless ( )
virtual

Checks if the compression is lossless.

The lossless mode is active if the compression level is 0 (the default).

Implements SoDataCompressor.

◆ uncompress()

virtual size_t SoJp3dDataCompressor::uncompress ( void *  dst,
size_t  dstLen,
const TileInfo tileInfo 
)
virtual

Uncompresses data from the internal buffer to the given buffer.

Parameters
dsta pointer to the destination buffer.
dstLenthe size of the destination buffer.
tileInfocontains information about the tile being processed
Returns
The number of uncompressed bytes.

Implements SoDataCompressor.


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