21#include <vrs/DataSlice.h>
22#include <vrs/ForwardDefinitions.h>
23#include <vrs/VrsExport.h>
24#include <vrs/WriteFileHandler.h>
25#include <vrs/helpers/IOVector.h>
59 FirstZstdPreset = ZstdFaster,
60 LastZstdPreset = ZstdMax,
63 CompressedLast = ZstdMax,
76VRS_API
CompressionType toEnum<CompressionType>(
const string& compressionTypeName);
85 static const size_t kMinByteCountForCompression;
104 uint32_t& outCompressedSize,
105 size_t headerSpace = 0);
120 size_t dataSliceCount,
122 uint32_t& outCompressedSize,
123 size_t headerSpace = 0);
152 uint32_t& inOutCompressedSize,
153 size_t maxCompressedSize = 0);
164 int endFrame(
WriteFileHandler& file, uint32_t& inOutCompressedSize,
size_t maxCompressedSize = 0);
169 return buffer_.data();
172 template <
class HeaderType>
174 return reinterpret_cast<HeaderType*
>(buffer_.data());
186 class CompressorImpl;
187 std::unique_ptr<CompressorImpl> impl_;
188 helpers::IOVector<uint8_t> buffer_;
Helper class to compress data using lz4 or zstd presets.
Definition Compressor.h:83
const void * getData() const
Definition Compressor.h:168
void clear()
Deallocate the internal buffer's storage.
Definition Compressor.h:179
HeaderType * getHeader()
Get the space reserved for a header.
Definition Compressor.h:173
The WriteFileHandler interface adds write operations to the FileHandler interface.
Definition WriteFileHandler.h:43
Definition Compressor.cpp:129
CompressionPreset
VRS Compression setting.
Definition Compressor.h:39
@ Lz4Tight
Slower compression speed, very fast decompression, better compression ratio.
@ Lz4Fast
Fast compression speed, very fast decompression, not great compression ratio.
@ Undefined
when not set explicitly
CompressionType
Type of compression. Used in VRS record headers, so never modify the values.
Definition Record.h:41
A non-owning view of a contiguous block of memory.
Definition DataSlice.h:24