VTK
vtkDataCompressor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataCompressor.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 =========================================================================*/
25 #ifndef vtkDataCompressor_h
26 #define vtkDataCompressor_h
27 
28 #include "vtkIOCoreModule.h" // For export macro
29 #include "vtkObject.h"
30 
32 
33 class VTKIOCORE_EXPORT vtkDataCompressor : public vtkObject
34 {
35 public:
37  void PrintSelf(ostream& os, vtkIndent indent);
38 
45  virtual size_t GetMaximumCompressionSpace(size_t size)=0;
46 
53  size_t Compress(unsigned char const* uncompressedData,
54  size_t uncompressedSize,
55  unsigned char* compressedData,
56  size_t compressionSpace);
57 
64  size_t Uncompress(unsigned char const* compressedData,
65  size_t compressedSize,
66  unsigned char* uncompressedData,
67  size_t uncompressedSize);
68 
73  vtkUnsignedCharArray* Compress(unsigned char const* uncompressedData,
74  size_t uncompressedSize);
75 
83  vtkUnsignedCharArray* Uncompress(unsigned char const* compressedData,
84  size_t compressedSize,
85  size_t uncompressedSize);
86 
87 protected:
90 
91  // Actual compression method. This must be provided by a subclass.
92  // Must return the size of the compressed data, or zero on error.
93  virtual size_t CompressBuffer(unsigned char const* uncompressedData,
94  size_t uncompressedSize,
95  unsigned char* compressedData,
96  size_t compressionSpace)=0;
97  // Actual decompression method. This must be provided by a subclass.
98  // Must return the size of the uncompressed data, or zero on error.
99  virtual size_t UncompressBuffer(unsigned char const* compressedData,
100  size_t compressedSize,
101  unsigned char* uncompressedData,
102  size_t uncompressedSize)=0;
103 private:
104  vtkDataCompressor(const vtkDataCompressor&) VTK_DELETE_FUNCTION;
105  void operator=(const vtkDataCompressor&) VTK_DELETE_FUNCTION;
106 };
107 
108 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:59
Abstract interface for data compression classes.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
Definition: vtkIndent.h:39
dynamic, self-adjusting array of unsigned char