version 3.3

VRS::ZLibFilter Class Reference

#include <vrs/io/zlibfilter.h>

Inheritance diagram for VRS::ZLibFilter:

VRS::DataFilter VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 VRS_TYPEINFO (ZLibFilter, DataFilter)
virtual SO< DataResourcefilter (DataResource *resource) const
 Implements the DataFilter interface and tries to uncompress the given data resource returning the uncompressed data in another data resource (or NULL on failure).

Static Public Member Functions

static SO< DataResourcecompress (SO< DataResource > resource, unsigned int compressionFactor=9)
 Compresses the given data resource and returns the result in another data resource.
static SO< DataResourcecompress (const void *sourceData, unsigned int sourceBytes, unsigned int compressionFactor=9)
static SO< DataResourceuncompress (SO< DataResource > resource, unsigned int estimatedOutputSize=0)
 Tries to uncompress the given data resource and returns the rsult in another data resource.
static bool uncompress (const void *sourceData, unsigned int sourceBytes, void *targetData, unsigned int targetBytes)
 Tries to decompress the source data (sourceData + sourceBytes) into the target memory region (targetData + targetBytes).


Member Function Documentation

VRS::ZLibFilter::VRS_TYPEINFO ( ZLibFilter  ,
DataFilter   
)

virtual SO<DataResource> VRS::ZLibFilter::filter ( DataResource resource  )  const [virtual]

Implements the DataFilter interface and tries to uncompress the given data resource returning the uncompressed data in another data resource (or NULL on failure).

See also:
uncompress

Implements VRS::DataFilter.

static SO<DataResource> VRS::ZLibFilter::compress ( SO< DataResource resource,
unsigned int  compressionFactor = 9 
) [static]

Compresses the given data resource and returns the result in another data resource.

If the compression fails, NULL is returned. The compression factor ranges from 0 (no compression; fastest) to 9 (best compression; slowest).

static SO<DataResource> VRS::ZLibFilter::compress ( const void *  sourceData,
unsigned int  sourceBytes,
unsigned int  compressionFactor = 9 
) [static]

static SO<DataResource> VRS::ZLibFilter::uncompress ( SO< DataResource resource,
unsigned int  estimatedOutputSize = 0 
) [static]

Tries to uncompress the given data resource and returns the rsult in another data resource.

If the decompression fails, NULL is returned. Since the original size is not encoded in the compressed data resource it could be expensive to retrieve it. By supplying the correct size as the estimatedOutputSize the decompression can be speed up. But it is not an error to specify the wrong size.

static bool VRS::ZLibFilter::uncompress ( const void *  sourceData,
unsigned int  sourceBytes,
void *  targetData,
unsigned int  targetBytes 
) [static]

Tries to decompress the source data (sourceData + sourceBytes) into the target memory region (targetData + targetBytes).

The number of target bytes must exactly match the size of the uncompressed data! Returns true on success, false otherwise.


The documentation for this class was generated from the following file:

Generated on Wed May 23 06:00:19 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact