ImFusion SDK 4.3
ImFusion::Compression::zlib Namespace Reference

Compression using the zlib algorithm. More...

Detailed Description

Compression using the zlib algorithm.

See also
https://www.zlib.net/

Enumerations

enum class  CompressionLevel { Default = -1 , None = 0 , BestSpeed = 1 , BestCompression = 9 }
 Selection of available zlib compression levels. More...
 

Functions

ByteBuffer compress (const ByteBufferView &inputBuffer, CompressionLevel compressionLevel=CompressionLevel::Default)
 Compress the given data using zlib.
 
ByteBuffer decompress (const ByteBufferView &inputBuffer)
 Decompress the given data using zlib into a newly created buffer.
 
bool decompressTo (const ByteBufferView &inputBuffer, ByteBufferMutableView outputBuffer)
 Decompress the given data using zlib into an already allocated buffer.
 

Enumeration Type Documentation

◆ CompressionLevel

enum class CompressionLevel
strong

Selection of available zlib compression levels.

see https://www.zlib.net/manual.html for more details

Function Documentation

◆ compress()

ByteBuffer compress ( const ByteBufferView & inputBuffer,
CompressionLevel compressionLevel = CompressionLevel::Default )

Compress the given data using zlib.

Returns an empty buffer on failure.

◆ decompress()

ByteBuffer decompress ( const ByteBufferView & inputBuffer)

Decompress the given data using zlib into a newly created buffer.

Use decompressTo() if you know the output size in advance and want to decompress into an already existing buffer. Returns an empty buffer on failure.

◆ decompressTo()

bool decompressTo ( const ByteBufferView & inputBuffer,
ByteBufferMutableView outputBuffer )

Decompress the given data using zlib into an already allocated buffer.

The output buffer must be of sufficient size and already allocated.

Search Tab / S to search, Esc to close