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

◆ get_region_group_data()

std::vector< DataVariant > MayaFlux::Kakshya::SoundStreamContainer::get_region_group_data ( const RegionGroup regions) const
overridevirtual

Get data for multiple regions efficiently.

Parameters
regionsVector of regions to extract data from
Returns
Vector of DataVariant vectors, one per region

Implements MayaFlux::Kakshya::NDDataContainer.

Definition at line 143 of file SoundStreamContainer.cpp.

144{
145 const auto& spans = get_span_cache();
146
147 if (spans.empty())
148 return {};
149
150 auto const_spans = spans | std::views::transform([](const auto& span) {
151 return std::span<const double>(span.data(), span.size());
152 });
153
154 auto extracted_channels = extract_group_data<double>(
155 std::vector<std::span<const double>>(const_spans.begin(), const_spans.end()),
157
158 return extracted_channels
159 | std::views::transform([](auto&& channel) {
160 return DataVariant(std::forward<decltype(channel)>(channel));
161 })
162 | std::ranges::to<std::vector>();
163}
const std::vector< std::span< double > > & get_span_cache() const
Get the cached spans for each channel, recomputing if dirty.
std::variant< std::vector< double >, std::vector< float >, std::vector< uint8_t >, std::vector< uint16_t >, std::vector< uint32_t >, std::vector< std::complex< float > >, std::vector< std::complex< double > >, std::vector< glm::vec2 >, std::vector< glm::vec3 >, std::vector< glm::vec4 >, std::vector< glm::mat4 > > DataVariant
Multi-type data storage for different precision needs.
Definition NDData.hpp:73

References MayaFlux::Kakshya::ContainerDataStructure::dimensions, get_span_cache(), m_structure, and MayaFlux::Kakshya::ContainerDataStructure::organization.

+ Here is the call graph for this function: