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 "vtkObject.h"
28 
30 
32 {
33 public:
35  void PrintSelf(ostream& os, vtkIndent indent);
36 
41  virtual unsigned long GetMaximumCompressionSpace(unsigned long size)=0;
42 
44 
47  unsigned long Compress(const unsigned char* uncompressedData,
48  unsigned long uncompressedSize,
49  unsigned char* compressedData,
50  unsigned long compressionSpace);
52 
54 
57  unsigned long Uncompress(const unsigned char* compressedData,
58  unsigned long compressedSize,
59  unsigned char* uncompressedData,
60  unsigned long uncompressedSize);
62 
64 
66  vtkUnsignedCharArray* Compress(const unsigned char* uncompressedData,
67  unsigned long uncompressedSize);
69 
71 
75  vtkUnsignedCharArray* Uncompress(const unsigned char* compressedData,
76  unsigned long compressedSize,
77  unsigned long uncompressedSize);
78 protected:
82 
83  // Actual compression method. This must be provided by a subclass.
84  // Must return the size of the compressed data, or zero on error.
85  virtual unsigned long CompressBuffer(const unsigned char* uncompressedData,
86  unsigned long uncompressedSize,
87  unsigned char* compressedData,
88  unsigned long compressionSpace)=0;
89  // Actual decompression method. This must be provided by a subclass.
90  // Must return the size of the uncompressed data, or zero on error.
91  virtual unsigned long UncompressBuffer(const unsigned char* compressedData,
92  unsigned long compressedSize,
93  unsigned char* uncompressedData,
94  unsigned long uncompressedSize)=0;
95 private:
96  vtkDataCompressor(const vtkDataCompressor&); // Not implemented.
97  void operator=(const vtkDataCompressor&); // Not implemented.
98 };
99 
100 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:60
Abstract interface for data compression classes.
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:37
dynamic, self-adjusting array of unsigned char
#define VTK_IO_EXPORT