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

◆ get_value_impl()

void MayaFlux::Kakshya::SoundStreamContainer::get_value_impl ( const std::vector< uint64_t > &  coords,
void *  out,
const std::type_info &  type 
) const
overrideprotectedvirtual

Type-erased single-element read.

Implementations copy the native element at coords into out if type matches their native type, otherwise no-op. out points to a caller-owned buffer of exactly sizeof(native type) bytes.

Implements MayaFlux::Kakshya::NDDataContainer< DataVariant >.

Definition at line 869 of file SoundStreamContainer.cpp.

873{
874 if (type != typeid(double) || coords.size() != 2 || !has_data())
875 return;
876
877 const uint64_t frame = coords[0];
878 const uint64_t channel = coords[1];
879
880 if (frame >= m_num_frames || channel >= m_num_channels)
881 return;
882
883 const auto& spans = get_span_cache();
884
886 if (spans.empty())
887 return;
888 const uint64_t idx = frame * m_num_channels + channel;
889 if (idx >= spans[0].size())
890 return;
891 *static_cast<double*>(out) = spans[0][idx];
892 } else {
893 if (channel >= spans.size() || frame >= spans[channel].size())
894 return;
895 *static_cast<double*>(out) = spans[channel][frame];
896 }
897}
bool size
std::vector< float > * out
std::vector< glm::ivec3 > coords
Definition VDBWriter.cpp:25
vk::PhysicalDeviceType type
Definition VKDevice.cpp:126
const std::vector< std::span< double > > & get_span_cache() const
Get the cached spans for each channel, recomputing if dirty.
bool has_data() const override
Check if the container currently holds any data.
@ INTERLEAVED
Single DataVariant with interleaved data (LRLRLR for stereo)

References coords, get_span_cache(), has_data(), MayaFlux::Kakshya::INTERLEAVED, m_num_channels, m_num_frames, m_structure, MayaFlux::Kakshya::ContainerDataStructure::organization, out, size, and type.

+ Here is the call graph for this function: