Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoJpegDataCompressor Class Reference

Large Data Management Jpeg data compression More...

#include <LDM/compressors/SoJpegDataCompressor.h>

+ Inheritance diagram for SoJpegDataCompressor:

Public Member Functions

 SoJpegDataCompressor ()
 Constructor.
 
virtual ~SoJpegDataCompressor ()
 Destructor.
 
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 *dest, size_t destLen, const TileInfo &tileInfo)
 Uncompresses data from the internal buffer to the given buffer.
 
virtual SbString getCompressionFormatName () const
 Returns the name of the compression algorithm used by this class.
 
virtual bool isLossless ()
 This compression is lossy.
 
- 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 Jpeg data compression

This class implements a compression scheme based on libjpeg. It is a lossy compression.

The setCompressionLevel method (SoDataCompressor or SoConverterParameters) accepts values between 0 and 100. 0 gives best compression but most loss of data. 100 gives minimum compression and minimum data alteration. Default is 85.

Limitations:

  • JPEG compression can only be used on 8-bit data sets.

SEE ALSO

SoGzipDataCompressor, SoDataCompressor, SoConverterParameters

Definition at line 65 of file SoJpegDataCompressor.h.

Constructor & Destructor Documentation

◆ SoJpegDataCompressor()

SoJpegDataCompressor::SoJpegDataCompressor ( )

Constructor.

◆ ~SoJpegDataCompressor()

virtual SoJpegDataCompressor::~SoJpegDataCompressor ( )
virtual

Destructor.

Member Function Documentation

◆ compress()

virtual size_t SoJpegDataCompressor::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 SoJpegDataCompressor::getCompressionFormatName ( ) const
inlinevirtual

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 ("jpeg" here).

Returns
An SbString containing "jpeg".

Implements SoDataCompressor.

Definition at line 103 of file SoJpegDataCompressor.h.

◆ isLossless()

virtual bool SoJpegDataCompressor::isLossless ( )
inlinevirtual

This compression is lossy.

Returns
false, the compression is lossy.

Implements SoDataCompressor.

Definition at line 109 of file SoJpegDataCompressor.h.

◆ uncompress()

virtual size_t SoJpegDataCompressor::uncompress ( void *  dest,
size_t  destLen,
const TileInfo tileInfo 
)
virtual

Uncompresses data from the internal buffer to the given buffer.

Parameters
desta pointer to the destination buffer.
destLenthe size of the destination buffer in bytes.
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: