public abstract class SoDataCompressor extends Inventor
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
Inventor.ConstructorCommand
VERBOSE_LEVEL, ZeroHandle
Modifier and Type | Method and Description |
---|---|
java.nio.ByteBuffer |
allocateCompressedBuffer(long size)
Allocates the internal buffer to hold the compressed data.
|
static long |
crc32(java.nio.ByteBuffer buf,
long len)
Utility function to get the CRC32 of a buffer.
|
static SoDataCompressor |
getAppropriateCompressor(java.lang.String name)
Create and return an instance of a compressor of the given type.
|
java.nio.ByteBuffer |
getCompressedBuffer()
Returns the compressed data.
|
java.lang.String |
getCompressionFormatName()
Returns the name of the compression algorithm used by this class.
|
long |
getCompressionLevel()
Returns the compression level.
|
boolean |
isLossless()
Returns true if the compression algorithm is lossless.
|
void |
setCompressionLevel(long level)
Sets the compression level.
|
dispose, getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
public boolean isLossless()
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.
public static long crc32(java.nio.ByteBuffer buf, long len)
buf
- a pointer to the data.
len
- the size of the buffer.
public void setCompressionLevel(long level)
level
- the level of the compression used. Valid compression levels are specific to the compression algorithm.public java.nio.ByteBuffer allocateCompressedBuffer(long size)
size
- is the size to allocate in bytes.public java.nio.ByteBuffer getCompressedBuffer()
public long getCompressionLevel()
setCompressionLevel
.public java.lang.String getCompressionFormatName()
public static SoDataCompressor getAppropriateCompressor(java.lang.String name)
name
- The name of the compressor.
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com