OpenVDB
9.0.1
|
Namespaces | |
Internal | |
Internal functions for compressed read/write of a NanoVDB GridHandle into a stream. | |
Classes | |
struct | GridMetaData |
struct | Header |
Data encoded at the head of each segment of a file or stream. More... | |
struct | MetaData |
Data encoded for each of the grids associated with a segment. More... | |
struct | Segment |
Typedefs | |
using | fileSize_t = uint64_t |
Enumerations | |
enum | Codec : uint16_t { NONE = 0, ZIP = 1, BLOSC = 2, END = 3 } |
Optional compression codecs. More... | |
Functions | |
const char * | toStr (Codec codec) |
uint64_t | stringHash (const char *cstr) |
Standard hash function to use on strings; std::hash may vary by platform/implementation and is know to produce frequent collisions. More... | |
uint64_t | stringHash (const std::string &str) |
Return a uint64_t hash key of a std::string. More... | |
uint64_t | reverseEndianness (uint64_t val) |
Return a uint64_t with its bytes reversed so we can check for endianness. More... | |
template<typename BufferT > | |
void | writeGrid (const std::string &fileName, const GridHandle< BufferT > &handle, Codec codec=Codec::NONE, int verbose=0) |
Write a single grid to file (over-writing existing content of the file) More... | |
template<typename BufferT > | |
void | writeGrid (std::ostream &os, const GridHandle< BufferT > &handle, Codec codec=Codec::NONE) |
Write a single grid to stream (starting at the current position) More... | |
template<typename BufferT = HostBuffer, template< typename... > class VecT = std::vector> | |
void | writeGrids (const std::string &fileName, const VecT< GridHandle< BufferT >> &handles, Codec codec=Codec::NONE, int verbose=0) |
Write multiple grids to file (over-writing existing content of the file) More... | |
template<typename BufferT = HostBuffer, template< typename... > class VecT = std::vector> | |
void | writeGrids (std::ostream &os, const VecT< GridHandle< BufferT >> &handles, Codec codec=Codec::NONE) |
Writes multiple grids to stream (starting at its current position) More... | |
template<typename BufferT = HostBuffer> | |
GridHandle< BufferT > | readGrid (const std::string &fileName, uint64_t n=0, int verbose=0, const BufferT &buffer=BufferT()) |
Read the n'th grid from file (defaults to first grid) More... | |
template<typename BufferT = HostBuffer> | |
GridHandle< BufferT > | readGrid (std::istream &is, uint64_t n=0, const BufferT &buffer=BufferT()) |
Read the n'th grid from stream (defaults to first grid) More... | |
template<typename BufferT = HostBuffer> | |
GridHandle< BufferT > | readGrid (const std::string &fileName, const std::string &gridName, int verbose=0, const BufferT &buffer=BufferT()) |
Read the first grid with a specific name. More... | |
template<typename BufferT = HostBuffer> | |
GridHandle< BufferT > | readGrid (std::istream &is, const std::string &gridName, const BufferT &buffer=BufferT()) |
Read the first grid with a specific name. More... | |
template<typename BufferT = HostBuffer, template< typename... > class VecT = std::vector> | |
VecT< GridHandle< BufferT > > | readGrids (const std::string &fileName, int verbose=0, const BufferT &buffer=BufferT()) |
Read all the grids in the file. More... | |
template<typename BufferT = HostBuffer, template< typename... > class VecT = std::vector> | |
VecT< GridHandle< BufferT > > | readGrids (std::istream &is, const BufferT &buffer=BufferT()) |
Real all grids at the current position of the input stream. More... | |
bool | hasGrid (const std::string &fileName, const std::string &gridName) |
Return true if the file contains a grid with the specified name. More... | |
bool | hasGrid (std::istream &is, const std::string &gridName) |
Return true if the stream contains a grid with the specified name. More... | |
std::vector< GridMetaData > | readGridMetaData (const std::string &fileName) |
Reads and returns a vector of meta data for all the grids found in the specified file. More... | |
std::vector< GridMetaData > | readGridMetaData (std::istream &is) |
Reads and returns a vector of meta data for all the grids found in the specified stream. More... | |
template<typename ValueT > | |
void | writeDense (const DenseGrid< ValueT > &grid, const char *fileName) |
template<typename BufferT > | |
void | writeDense (const DenseGridHandle< BufferT > &handle, const char *fileName) |
template<typename BufferT = HostBuffer> | |
DenseGridHandle< BufferT > | readDense (const char *fileName, const BufferT &allocator=BufferT()) |
using fileSize_t = uint64_t |
We fix a specific size for counting bytes in files so that they are saved the same regardless of machine precision. (Note there are still little/bigendian issues, however)
|
strong |
|
inline |
Return true if the file contains a grid with the specified name.
|
inline |
Return true if the stream contains a grid with the specified name.
DenseGridHandle<BufferT> nanovdb::io::readDense | ( | const char * | fileName, |
const BufferT & | allocator = BufferT() |
||
) |
GridHandle< BufferT > readGrid | ( | const std::string & | fileName, |
uint64_t | n = 0 , |
||
int | verbose = 0 , |
||
const BufferT & | buffer = BufferT() |
||
) |
Read the n'th grid from file (defaults to first grid)
Read the n'th grid.
If | n exceeds the number of grids in the file |
GridHandle< BufferT > readGrid | ( | std::istream & | is, |
uint64_t | n = 0 , |
||
const BufferT & | buffer = BufferT() |
||
) |
Read the n'th grid from stream (defaults to first grid)
If | n exceeds the number of grids in the stream |
GridHandle< BufferT > readGrid | ( | const std::string & | fileName, |
const std::string & | gridName, | ||
int | verbose = 0 , |
||
const BufferT & | buffer = BufferT() |
||
) |
Read the first grid with a specific name.
GridHandle< BufferT > readGrid | ( | std::istream & | is, |
const std::string & | gridName, | ||
const BufferT & | buffer = BufferT() |
||
) |
Read the first grid with a specific name.
|
inline |
Reads and returns a vector of meta data for all the grids found in the specified file.
|
inline |
Reads and returns a vector of meta data for all the grids found in the specified stream.
VecT< GridHandle< BufferT > > readGrids | ( | const std::string & | fileName, |
int | verbose = 0 , |
||
const BufferT & | buffer = BufferT() |
||
) |
Read all the grids in the file.
Read all the grids.
VecT< GridHandle< BufferT > > readGrids | ( | std::istream & | is, |
const BufferT & | buffer = BufferT() |
||
) |
Real all grids at the current position of the input stream.
|
inline |
Return a uint64_t with its bytes reversed so we can check for endianness.
|
inline |
Standard hash function to use on strings; std::hash may vary by platform/implementation and is know to produce frequent collisions.
|
inline |
Return a uint64_t hash key of a std::string.
|
inline |
void nanovdb::io::writeDense | ( | const DenseGrid< ValueT > & | grid, |
const char * | fileName | ||
) |
void nanovdb::io::writeDense | ( | const DenseGridHandle< BufferT > & | handle, |
const char * | fileName | ||
) |
void writeGrid | ( | const std::string & | fileName, |
const GridHandle< BufferT > & | handle, | ||
Codec | codec = Codec::NONE , |
||
int | verbose = 0 |
||
) |
Write a single grid to file (over-writing existing content of the file)
void writeGrid | ( | std::ostream & | os, |
const GridHandle< BufferT > & | handle, | ||
Codec | codec = Codec::NONE |
||
) |
Write a single grid to stream (starting at the current position)
void writeGrids | ( | const std::string & | fileName, |
const VecT< GridHandle< BufferT >> & | handles, | ||
Codec | codec = Codec::NONE , |
||
int | verbose = 0 |
||
) |
Write multiple grids to file (over-writing existing content of the file)
void writeGrids | ( | std::ostream & | os, |
const VecT< GridHandle< BufferT >> & | handles, | ||
Codec | codec = Codec::NONE |
||
) |
Writes multiple grids to stream (starting at its current position)