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 =========================================================================*/
24 #ifndef vtkDataCompressor_h
25 #define vtkDataCompressor_h
26 
27 #include "vtkIOCoreModule.h" // For export macro
28 #include "vtkObject.h"
29 
31 
33 {
34 public:
36  void PrintSelf(ostream& os, vtkIndent indent);
37 
42  virtual size_t GetMaximumCompressionSpace(size_t size)=0;
43 
45 
48  size_t Compress(unsigned char const* uncompressedData,
49  size_t uncompressedSize,
50  unsigned char* compressedData,
51  size_t compressionSpace);
53 
55 
58  size_t Uncompress(unsigned char const* compressedData,
59  size_t compressedSize,
60  unsigned char* uncompressedData,
61  size_t uncompressedSize);
63 
65 
67  vtkUnsignedCharArray* Compress(unsigned char const* uncompressedData,
68  size_t uncompressedSize);
70 
72 
76  vtkUnsignedCharArray* Uncompress(unsigned char const* compressedData,
77  size_t compressedSize,
78  size_t uncompressedSize);
79 protected:
83 
84  // Actual compression method. This must be provided by a subclass.
85  // Must return the size of the compressed data, or zero on error.
86  virtual size_t CompressBuffer(unsigned char const* uncompressedData,
87  size_t uncompressedSize,
88  unsigned char* compressedData,
89  size_t compressionSpace)=0;
90  // Actual decompression method. This must be provided by a subclass.
91  // Must return the size of the uncompressed data, or zero on error.
92  virtual size_t UncompressBuffer(unsigned char const* compressedData,
93  size_t compressedSize,
94  unsigned char* uncompressedData,
95  size_t uncompressedSize)=0;
96 private:
97  vtkDataCompressor(const vtkDataCompressor&); // Not implemented.
98  void operator=(const vtkDataCompressor&); // Not implemented.
99 };
100 
101 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
Abstract interface for data compression classes.
#define VTKIOCORE_EXPORT
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
dynamic, self-adjusting array of unsigned char