OpenVDB  9.0.1
Classes | Functions | Variables
openvdb::v9_0::compression Namespace Reference

Classes

class  Page
 Stores a variable-size, compressed, delayed-load Page of data that is loaded into memory when accessed. Access to the Page is thread-safe as loading and decompressing the data is protected by a mutex. More...
 
class  PagedInputStream
 A Paging wrapper to std::istream that is responsible for reading from a given input stream and creating Page objects and PageHandles that reference those pages for delayed reading. More...
 
class  PagedOutputStream
 A Paging wrapper to std::ostream that is responsible for writing from a given output stream at intervals set by the PageSize. As Pages are variable in size, they are flushed to disk as soon as sufficiently large. More...
 
class  PageHandle
 A PageHandle holds a unique ptr to a Page and a specific stream pointer to a point within the decompressed Page buffer. More...
 

Functions

OPENVDB_API bool bloscCanCompress ()
 Returns true if compression is available. More...
 
OPENVDB_API size_t bloscUncompressedSize (const char *buffer)
 Retrieves the uncompressed size of buffer when uncompressed. More...
 
OPENVDB_API void bloscCompress (char *compressedBuffer, size_t &compressedBytes, const size_t bufferBytes, const char *uncompressedBuffer, const size_t uncompressedBytes)
 Compress into the supplied buffer. More...
 
OPENVDB_API std::unique_ptr< char[]> bloscCompress (const char *buffer, const size_t uncompressedBytes, size_t &compressedBytes, const bool resize=true)
 Compress and return the heap-allocated compressed buffer. More...
 
OPENVDB_API size_t bloscCompressedSize (const char *buffer, const size_t uncompressedBytes)
 Convenience wrapper to retrieve the compressed size of buffer when compressed. More...
 
OPENVDB_API void bloscDecompress (char *uncompressedBuffer, const size_t expectedBytes, const size_t bufferBytes, const char *compressedBuffer)
 Decompress into the supplied buffer. Will throw if decompression fails or uncompressed buffer has insufficient space in which to decompress. More...
 
OPENVDB_API std::unique_ptr< char[]> bloscDecompress (const char *buffer, const size_t expectedBytes, const bool resize=true)
 Decompress and return the the heap-allocated uncompressed buffer. More...
 

Variables

static const int BLOSC_MINIMUM_BYTES = 48
 
static const int BLOSC_PAD_BYTES = 128
 
static const int PageSize = 1024 * 1024
 

Function Documentation

OPENVDB_API bool openvdb::v9_0::compression::bloscCanCompress ( )

Returns true if compression is available.

OPENVDB_API void openvdb::v9_0::compression::bloscCompress ( char *  compressedBuffer,
size_t &  compressedBytes,
const size_t  bufferBytes,
const char *  uncompressedBuffer,
const size_t  uncompressedBytes 
)

Compress into the supplied buffer.

Parameters
compressedBufferthe buffer to compress
compressedBytesnumber of compressed bytes
bufferBytesthe number of bytes in compressedBuffer available to be filled
uncompressedBufferthe uncompressed buffer to compress
uncompressedBytesnumber of uncompressed bytes
OPENVDB_API std::unique_ptr<char[]> openvdb::v9_0::compression::bloscCompress ( const char *  buffer,
const size_t  uncompressedBytes,
size_t &  compressedBytes,
const bool  resize = true 
)

Compress and return the heap-allocated compressed buffer.

Parameters
bufferthe buffer to compress
uncompressedBytesnumber of uncompressed bytes
compressedBytesnumber of compressed bytes (written to this variable)
resizethe compressed buffer will be exactly resized to remove the portion used for Blosc overhead, for efficiency this can be skipped if it is known that the resulting buffer is temporary
OPENVDB_API size_t openvdb::v9_0::compression::bloscCompressedSize ( const char *  buffer,
const size_t  uncompressedBytes 
)

Convenience wrapper to retrieve the compressed size of buffer when compressed.

Parameters
bufferthe uncompressed buffer
uncompressedBytesnumber of uncompressed bytes
OPENVDB_API void openvdb::v9_0::compression::bloscDecompress ( char *  uncompressedBuffer,
const size_t  expectedBytes,
const size_t  bufferBytes,
const char *  compressedBuffer 
)

Decompress into the supplied buffer. Will throw if decompression fails or uncompressed buffer has insufficient space in which to decompress.

Parameters
uncompressedBufferthe uncompressed buffer to decompress into
expectedBytesthe number of bytes expected once the buffer is decompressed
bufferBytesthe number of bytes in uncompressedBuffer available to be filled
compressedBufferthe compressed buffer to decompress
OPENVDB_API std::unique_ptr<char[]> openvdb::v9_0::compression::bloscDecompress ( const char *  buffer,
const size_t  expectedBytes,
const bool  resize = true 
)

Decompress and return the the heap-allocated uncompressed buffer.

Parameters
bufferthe buffer to decompress
expectedBytesthe number of bytes expected once the buffer is decompressed
resizethe compressed buffer will be exactly resized to remove the portion used for Blosc overhead, for efficiency this can be skipped if it is known that the resulting buffer is temporary
OPENVDB_API size_t openvdb::v9_0::compression::bloscUncompressedSize ( const char *  buffer)

Retrieves the uncompressed size of buffer when uncompressed.

Parameters
bufferthe compressed buffer

Variable Documentation

const int BLOSC_MINIMUM_BYTES = 48
static
const int BLOSC_PAD_BYTES = 128
static
const int PageSize = 1024 * 1024
static