VTK
vtkLZ4DataCompressor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkZLibDataCompressor.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 =========================================================================*/
15 // .NAME vtkLZ4DataCompressor - Data compression using zlib.
16 // .SECTION Description
17 // vtkLZ4DataCompressor provides a concrete vtkDataCompressor class
18 // using LZ4 for compressing and uncompressing data.
19 
20 #ifndef vtkLZ4DataCompressor_h
21 #define vtkLZ4DataCompressor_h
22 
23 #include "vtkIOCoreModule.h" // For export macro
24 #include "vtkDataCompressor.h"
25 
26 class VTKIOCORE_EXPORT vtkLZ4DataCompressor : public vtkDataCompressor
27 {
28 public:
30  void PrintSelf(ostream& os, vtkIndent indent) override;
31  static vtkLZ4DataCompressor* New();
32 
33  // Description:
34  // Get the maximum space that may be needed to store data of the
35  // given uncompressed size after compression. This is the minimum
36  // size of the output buffer that can be passed to the four-argument
37  // Compress method.
38  size_t GetMaximumCompressionSpace(size_t size) override;
39 
40  // Description:
41  // Get/Set the compression level.
42  vtkSetClampMacro(AccelerationLevel, int, 1, VTK_INT_MAX);
43  vtkGetMacro(AccelerationLevel, int);
44 
45 protected:
47  ~vtkLZ4DataCompressor() override;
48 
50 
51  // Compression method required by vtkDataCompressor.
52  size_t CompressBuffer(unsigned char const* uncompressedData,
53  size_t uncompressedSize,
54  unsigned char* compressedData,
55  size_t compressionSpace) override;
56  // Decompression method required by vtkDataCompressor.
57  size_t UncompressBuffer(unsigned char const* compressedData,
58  size_t compressedSize,
59  unsigned char* uncompressedData,
60  size_t uncompressedSize) override;
61 private:
63  void operator=(const vtkLZ4DataCompressor&) = delete;
64 };
65 
66 #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.
#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:39
virtual size_t UncompressBuffer(unsigned char const *compressedData, size_t compressedSize, unsigned char *uncompressedData, size_t uncompressedSize)=0
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...