|
| AZ_CLASS_ALLOCATOR (CompressorZLib, AZ::SystemAllocator) |
|
| CompressorZLib (unsigned int decompressionCachePerStream=64 *1024, unsigned int dataBufferSize=128 *1024) |
|
AZ::u32 | GetTypeId () const override |
| Return compressor type id.
|
|
bool | ReadHeaderAndData (CompressorStream *stream, AZ::u8 *data, unsigned int dataSize) override |
| Called when we open a stream to Read for the first time. Data contains the first. dataSize <= m_maxHeaderSize.
|
|
bool | WriteHeaderAndData (CompressorStream *stream) override |
| Called when we are about to start writing to a compressed stream.
|
|
SizeType | Read (CompressorStream *stream, SizeType byteSize, SizeType offset, void *buffer) override |
| Forwarded function from the Device when we from a compressed stream.
|
|
SizeType | Write (CompressorStream *stream, SizeType byteSize, const void *data, SizeType offset=SizeType(-1)) override |
| Forwarded function from the Device when we write to a compressed stream.
|
|
bool | WriteSeekPoint (CompressorStream *stream) override |
| Write a seek point.
|
|
bool | StartCompressor (CompressorStream *stream, int compressionLevel, SizeType autoSeekDataSize) override |
| Set auto seek point even dataSize bytes.
|
|
bool | Close (CompressorStream *stream) override |
| Called just before we close the stream. All compression data will be flushed and finalized. (You can't add data afterwards).
|
|
virtual | ~Compressor () |
| When we open a stream to check if it's compressed we read the first m_maxHeaderSize bytes.
|
|
virtual AZ::u32 | GetTypeId () const =0 |
| Return compressor type id.
|
|
virtual bool | ReadHeaderAndData (CompressorStream *stream, AZ::u8 *data, unsigned int dataSize)=0 |
| Called when we open a stream to Read for the first time. Data contains the first. dataSize <= m_maxHeaderSize.
|
|
virtual bool | WriteHeaderAndData (CompressorStream *stream) |
| Called when we are about to start writing to a compressed stream. (Must be called first to write compressor header)
|
|
virtual SizeType | Read (CompressorStream *stream, SizeType byteSize, SizeType offset, void *buffer)=0 |
| Forwarded function from the Device when we from a compressed stream.
|
|
virtual SizeType | Write (CompressorStream *stream, SizeType byteSize, const void *data, SizeType offset=SizeType(-1))=0 |
| Forwarded function from the Device when we write to a compressed stream.
|
|
virtual bool | WriteSeekPoint (CompressorStream *stream) |
| Write a seek point.
|
|
virtual bool | StartCompressor (CompressorStream *stream, int compressionLevel, SizeType autoSeekDataSize) |
| Initializes Compressor for writing data.
|
|
virtual bool | Close (CompressorStream *stream)=0 |
| Called just before we close the stream. All compression data will be flushed and finalized. (You can't add data afterwards).
|
|
|
CompressorStream * | m_lastReadStream |
| Cached last stream we read data into the m_dataBuffer.
|
|
SizeType | m_lastReadStreamOffset |
| Offset of the last read (in the m_dataBuffer) in the compressed stream.
|
|
SizeType | m_lastReadStreamSize |
| Size of the data in m_dataBuffer of the last read.
|
|
unsigned char * | m_compressedDataBuffer |
| Data buffer used to read/write compressed data.
|
|
unsigned int | m_compressedDataBufferSize |
| Data buffer size (stored so we can lazy allocate m_dataBuffer as we need).
|
|
unsigned int | m_compressedDataBufferUseCount |
| Data buffer use count.
|
|
unsigned int | m_decompressionCachePerStream |
| Cache per stream for each compressed stream stream in bytes.
|
|
ZLib compressor implementation. Note: As of now the CompressorZLib is the only supported compressor. We can move much of the caching functionality into the base Compressor class to be shared. Please do so when you have an actual need to implement another compressor, don't just copy and paste.