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

vtkDataCompressor.h

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