![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Core/Compression.h>
When (de)compressing many times it is recommended to allocate the context only once and reuse it for each successive operations. More...
When (de)compressing many times it is recommended to allocate the context only once and reuse it for each successive operations.
This will save execution time and memory.
Public Member Functions | |
| ByteBuffer | compress (const ByteBufferView &inputBuffer, CompressionLevel compressionLevel=CompressionLevel::Average) const |
| Compress the given input data using the zstd algorithm. | |
| size_t | compressTo (const ByteBufferView &inputBuffer, ByteBufferMutableView outputBuffer, CompressionLevel compressionLevel=CompressionLevel::Average) const |
| Compress the given input data to the given buffer using the zstd algorithm. | |
| ByteBuffer | decompress (const ByteBufferView &inputBuffer) const |
| Decompress the given input data using the zstd algorithm. | |
| bool | decompressTo (const ByteBufferView &inputBuffer, ByteBufferMutableView outputBuffer) const |
| Decompress the given data using zstd into an already allocated buffer. | |
| ByteBuffer compress | ( | const ByteBufferView & | inputBuffer, |
| CompressionLevel | compressionLevel = CompressionLevel::Average ) const |
Compress the given input data using the zstd algorithm.
Returns an empty buffer on failure.
| inputBuffer | Input data to compress |
| compressionLevel | Compression level to choose |
| size_t compressTo | ( | const ByteBufferView & | inputBuffer, |
| ByteBufferMutableView | outputBuffer, | ||
| CompressionLevel | compressionLevel = CompressionLevel::Average ) const |
Compress the given input data to the given buffer using the zstd algorithm.
This variant will fail if the output buffer is not of sufficient size. Returns The size of the compressed data, or 0 if the output buffer was not of sufficient size.
| inputBuffer | Input data to compress |
| outputBuffer | Output buffer to compress into |
| compressionLevel | Compression level to choose |
| ByteBuffer decompress | ( | const ByteBufferView & | inputBuffer | ) | const |
Decompress the given input data using the zstd algorithm.
Returns an empty buffer on failure.
| inputBuffer | Input data to decompress, must have been created using zstd compression |
| bool decompressTo | ( | const ByteBufferView & | inputBuffer, |
| ByteBufferMutableView | outputBuffer ) const |
Decompress the given data using zstd into an already allocated buffer.
| inputBuffer | Input data to decompress, must have been created using zstd compression |
| outputBuffer | Output buffer to decompress into, must be of sufficient size and already allocated |