Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

dox/IO/vtkDataCompressor.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkDataCompressor.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00028 #ifndef __vtkDataCompressor_h
00029 #define __vtkDataCompressor_h
00030 
00031 #include "vtkObject.h"
00032 
00033 class vtkUnsignedCharArray;
00034 
00035 class VTK_IO_EXPORT vtkDataCompressor : public vtkObject
00036 {
00037 public:
00038   vtkTypeRevisionMacro(vtkDataCompressor,vtkObject);
00039   void PrintSelf(ostream& os, vtkIndent indent);
00040   
00045   virtual unsigned long GetMaximumCompressionSpace(unsigned long size)=0;
00046   
00048 
00051   unsigned long Compress(const unsigned char* uncompressedData,
00052                          unsigned long uncompressedSize,
00053                          unsigned char* compressedData,
00054                          unsigned long compressionSpace);
00056   
00058 
00061   unsigned long Uncompress(const unsigned char* compressedData,
00062                            unsigned long compressedSize,
00063                            unsigned char* uncompressedData,
00064                            unsigned long uncompressedSize);
00066   
00068 
00070   vtkUnsignedCharArray* Compress(const unsigned char* uncompressedData,
00071                                  unsigned long uncompressedSize);
00073   
00075 
00079   vtkUnsignedCharArray* Uncompress(const unsigned char* compressedData,
00080                                    unsigned long compressedSize,
00081                                    unsigned long uncompressedSize);
00083 protected:
00084   vtkDataCompressor();
00085   ~vtkDataCompressor();
00086   
00087   // Actual compression method.  This must be provided by a subclass.
00088   // Must return the size of the compressed data, or zero on error.
00089   virtual unsigned long CompressBuffer(const unsigned char* uncompressedData,
00090                                        unsigned long uncompressedSize,
00091                                        unsigned char* compressedData,
00092                                        unsigned long compressionSpace)=0;  
00093   // Actual decompression method.  This must be provided by a subclass.
00094   // Must return the size of the uncompressed data, or zero on error.
00095   virtual unsigned long UncompressBuffer(const unsigned char* compressedData,
00096                                          unsigned long compressedSize,
00097                                          unsigned char* uncompressedData,
00098                                          unsigned long uncompressedSize)=0;
00099 private:
00100   vtkDataCompressor(const vtkDataCompressor&);  // Not implemented.
00101   void operator=(const vtkDataCompressor&);  // Not implemented.
00102 };
00103 
00104 #endif