Loading...
Searching...
No Matches
openvdb::v11_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.
OPENVDB_API size_t | bloscUncompressedSize (const char *buffer)
| Retrieves the uncompressed size of buffer when uncompressed.
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.
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.
OPENVDB_API size_t | bloscCompressedSize (const char *buffer, const size_t uncompressedBytes)
| Convenience wrapper to retrieve the compressed size of buffer when compressed.
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.
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.

## Variables

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

## Function Documentation

## bloscCanCompress()

OPENVDB_API bool bloscCanCompress | ( |  | ) |

Returns true if compression is available.

## bloscCompress() [1/2]

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.

Parameters

  compressedBuffer | the buffer to compress
  compressedBytes | number of compressed bytes
  bufferBytes | the number of bytes in compressedBuffer available to be filled
  uncompressedBuffer | the uncompressed buffer to compress
  uncompressedBytes | number of uncompressed bytes

## bloscCompress() [2/2]

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.

Parameters

  buffer | the buffer to compress
  uncompressedBytes | number of uncompressed bytes
  compressedBytes | number of compressed bytes (written to this variable)
  resize | the 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

## bloscCompressedSize()

OPENVDB_API size_t bloscCompressedSize | ( | const char * | buffer,
|  | const size_t | uncompressedBytes
| ) |  |

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

Parameters

  buffer | the uncompressed buffer
  uncompressedBytes | number of uncompressed bytes

## bloscDecompress() [1/2]

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.

Parameters

  uncompressedBuffer | the uncompressed buffer to decompress into
  expectedBytes | the number of bytes expected once the buffer is decompressed
  bufferBytes | the number of bytes in uncompressedBuffer available to be filled
  compressedBuffer | the compressed buffer to decompress

## bloscDecompress() [2/2]

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.

Parameters

  buffer | the buffer to decompress
  expectedBytes | the number of bytes expected once the buffer is decompressed
  resize | the 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

## bloscUncompressedSize()

OPENVDB_API size_t bloscUncompressedSize | ( | const char * | buffer | ) |

Retrieves the uncompressed size of buffer when uncompressed.

Parameters

  buffer | the compressed buffer

## Variable Documentation

## BLOSC_MINIMUM_BYTES

const int BLOSC_MINIMUM_BYTES = 48

static

## BLOSC_PAD_BYTES

const int BLOSC_PAD_BYTES = 128

static

## PageSize

const int PageSize = 1024 * 1024

static