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

◆ is_consistent()

bool MayaFlux::Kakshya::VolumeData::is_consistent ( ) const
inline

Check that every field is densely populated over the lattice.

Verifies a nonzero lattice, at least one field, no empty or duplicated names, and that each field holds exactly cell_count() elements.

Producers should invoke this before handing the data to a writer. Writers should invoke it before trusting any pointer they take from it, as EXRWriter does with ImageData.

Definition at line 144 of file VolumeData.hpp.

145 {
146 if (cell_count() == 0 || fields.empty()) {
147 return false;
148 }
149
150 for (size_t i = 0; i < fields.size(); ++i) {
151 if (fields[i].name.empty() || fields[i].element_count() != cell_count()) {
152 return false;
153 }
154 for (size_t j = i + 1; j < fields.size(); ++j) {
155 if (fields[i].name == fields[j].name) {
156 return false;
157 }
158 }
159 }
160
161 return true;
162 }
std::string name
Definition VKDevice.cpp:143
size_t cell_count() const
Cells in the lattice, which every field's element_count() must equal.
std::vector< VolumeField > fields

References cell_count(), fields, and name.

Referenced by MayaFlux::IO::download_volume(), MayaFlux::IO::VolumeReader::materialize(), MayaFlux::IO::upload_volume(), and MayaFlux::IO::VDBWriter::write().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: