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

◆ declare_scalar()

ScalarRef MayaFlux::Buffers::VolumeGridBuffer::declare_scalar ( std::string  name)

Declare a double-buffered scalar field.

Parameters
nameLookup key, unique within this volume.
Returns
Ref naming the field, or a ref with an empty name if the declaration was rejected.

Definition at line 160 of file VolumeGridBuffer.cpp.

161{
162 if (!allocate_field(name, sizeof(float), true)) {
163 return {};
164 }
165
166 return ScalarRef {
167 .name = std::move(name),
168 .owner = std::dynamic_pointer_cast<VolumeGridBuffer>(shared_from_this()),
169 };
170}
bool allocate_field(const std::string &name, size_t stride_bytes, bool double_buffered)
Allocate one field's slots and register it.

References allocate_field(), and MayaFlux::Buffers::ScalarRef::name.

+ Here is the call graph for this function: