MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ load() [1/2]

std::optional< Kakshya::VolumeData > MayaFlux::IO::VolumeReader::load ( const std::string &  filepath,
const Kinesis::Lattice3D lattice,
const VolumeReadOptions options = {} 
)

Load every selected grid onto a caller-supplied lattice.

As load(), but the output lattice is lattice rather than derived from the file. The only path that round-trips a write exactly; see the class docs.

Parameters
filepathPath to the .vdb file.
latticeOutput lattice. Its resolution and bounds are used as given; nothing about it is validated against the file's own transform.
optionsGrid selection.
Returns
Populated VolumeData, or nullopt on failure; check get_last_error().

Definition at line 133 of file VolumeReader.cpp.

137{
138 if (!open(filepath)) {
139 return std::nullopt;
140 }
141 auto result = extract(lattice, options);
142 close();
143 return result;
144}
bool open(const std::string &filepath, FileReadOptions options=FileReadOptions::ALL) override
Open a file for reading.
void close() override
Close the currently open file.
std::optional< Kakshya::VolumeData > extract(const VolumeReadOptions &options={}) const
Extract every selected grid after open() has already been called.

References close(), extract(), and open().

+ Here is the call graph for this function: