| VRS - The Virtual Rendering System |
| version 3.3 |
#include <vrs/io/zlibfilter.h>

Public Member Functions | |
| VRS_TYPEINFO (ZLibFilter, DataFilter) | |
| virtual SO< DataResource > | filter (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< DataResource > | compress (SO< DataResource > resource, unsigned int compressionFactor=9) |
| Compresses the given data resource and returns the result in another data resource. | |
| static SO< DataResource > | compress (const void *sourceData, unsigned int sourceBytes, unsigned int compressionFactor=9) |
| static SO< DataResource > | uncompress (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). | |
| 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).
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.