FreeMat

- Main Page
- Related Pages

vtkDataCompressor

Section: Visualization Toolkit IO Classes

# Usage

vtkDataCompressor provides a universal interface for data compression. Subclasses provide one compression method and one decompression method. The public interface to all compressors remains the same, and is defined by this class.

To create an instance of class vtkDataCompressor, simply invoke its constructor as follows

      obj = vtkDataCompressor

# Methods

The class vtkDataCompressor has several methods that can be used. They are listed below. Note that the documentation is translated automatically from the VTK sources, and may not be completely intelligible. When in doubt, consult the VTK website. In the methods listed below, `obj` is an instance of the vtkDataCompressor class.

- `string = obj.GetClassName ()`
- `int = obj.IsA (string name)`
- `vtkDataCompressor = obj.NewInstance ()`
- `vtkDataCompressor = obj.SafeDownCast (vtkObject o)`
- `long = obj.GetMaximumCompressionSpace (long size)` - Get the maximum space that may be needed to store data of the given uncompressed size after compression. This is the minimum size of the output buffer that can be passed to the four-argument Compress method.
- `long = obj.Compress (string uncompressedData, long uncompressedSize, string compressedData, long compressionSpace)` - Compress the given input data buffer into the given output buffer. The size of the output buffer must be at least as large as the value given by GetMaximumCompressionSpace for the given input size.
- `long = obj.Uncompress (string compressedData, long compressedSize, string uncompressedData, long uncompressedSize)` - Uncompress the given input data into the given output buffer. The size of the uncompressed data must be known by the caller. It should be transmitted from the compressor by a means outside of this class.
- `vtkUnsignedCharArray = obj.Compress (string uncompressedData, long uncompressedSize)` - Compress the given data. A vtkUnsignedCharArray containing the compressed data is returned with a reference count of 1.
- `vtkUnsignedCharArray = obj.Uncompress (string compressedData, long compressedSize, long uncompressedSize)` - Uncompress the given data. A vtkUnsignedCharArray containing the compressed data is returned with a reference count of 1. The size of the uncompressed data must be known by the caller. It should be transmitted from the compressor by a means outside of this class.