VTK
vtkLZ4DataCompressor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkLZ4DataCompressor.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
23 #ifndef vtkLZ4DataCompressor_h
24 #define vtkLZ4DataCompressor_h
25 
26 #include "vtkIOCoreModule.h" // For export macro
27 #include "vtkDataCompressor.h"
28 
29 class VTKIOCORE_EXPORT vtkLZ4DataCompressor : public vtkDataCompressor
30 {
31 public:
33  void PrintSelf(ostream& os, vtkIndent indent) override;
34  static vtkLZ4DataCompressor* New();
35 
42  size_t GetMaximumCompressionSpace(size_t size) override;
46  // Compression level getter required by vtkDataCompressor.
47  int GetCompressionLevel() override;
48 
49  // Compression level setter required by vtkDataCompresor.
50  void SetCompressionLevel(int compressionLevel) override;
51 
52  // Direct setting of AccelerationLevel allows more direct
53  // control over LZ4 compressor
54  vtkSetClampMacro(AccelerationLevel, int, 1, VTK_INT_MAX);
55  vtkGetMacro(AccelerationLevel, int);
56 
57 protected:
59  ~vtkLZ4DataCompressor() override;
60 
62 
63  // Compression method required by vtkDataCompressor.
64  size_t CompressBuffer(unsigned char const* uncompressedData,
65  size_t uncompressedSize,
66  unsigned char* compressedData,
67  size_t compressionSpace) override;
68  // Decompression method required by vtkDataCompressor.
69  size_t UncompressBuffer(unsigned char const* compressedData,
70  size_t compressedSize,
71  unsigned char* uncompressedData,
72  size_t uncompressedSize) override;
73 private:
75  void operator=(const vtkLZ4DataCompressor&) = delete;
76 };
77 
78 #endif
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Abstract interface for data compression classes.
Data compression using LZ4.
#define VTK_INT_MAX
Definition: vtkType.h:157
virtual size_t CompressBuffer(unsigned char const *uncompressedData, size_t uncompressedSize, unsigned char *compressedData, size_t compressionSpace)=0
virtual size_t GetMaximumCompressionSpace(size_t size)=0
Get the maximum space that may be needed to store data of the given uncompressed size after compressi...
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual size_t UncompressBuffer(unsigned char const *compressedData, size_t compressedSize, unsigned char *uncompressedData, size_t uncompressedSize)=0
virtual void SetCompressionLevel(int compressionLevel)=0
Compression performance varies greatly with compression level Require level setting from any vtkDataC...
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
virtual int GetCompressionLevel()=0