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
33class VTKIOCORE_EXPORT vtkDataCompressor : public vtkObject
34{
35public:
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
87protected:
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;
103private:
104 vtkDataCompressor(const vtkDataCompressor&) VTK_DELETE_FUNCTION;
105 void operator=(const vtkDataCompressor&) VTK_DELETE_FUNCTION;
106};
107
108#endif
Abstract interface for data compression classes.
virtual size_t UncompressBuffer(unsigned char const *compressedData, size_t compressedSize, unsigned char *uncompressedData, size_t uncompressedSize)=0
vtkUnsignedCharArray * Compress(unsigned char const *uncompressedData, size_t uncompressedSize)
Compress the given data.
size_t Uncompress(unsigned char const *compressedData, size_t compressedSize, unsigned char *uncompressedData, size_t uncompressedSize)
Uncompress the given input data into the given output buffer.
virtual size_t CompressBuffer(unsigned char const *uncompressedData, size_t uncompressedSize, unsigned char *compressedData, size_t compressionSpace)=0
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkUnsignedCharArray * Uncompress(unsigned char const *compressedData, size_t compressedSize, size_t uncompressedSize)
Uncompress the given data.
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...
size_t Compress(unsigned char const *uncompressedData, size_t uncompressedSize, unsigned char *compressedData, size_t compressionSpace)
Compress the given input data buffer into the given output buffer.
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract base class for most VTK objects
Definition: vtkObject.h:60
dynamic, self-adjusting array of unsigned char
@ size
Definition: vtkX3D.h:253