MayaFlux 0.5.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 140 of file SoundStreamContainer.cpp.

141{
142 const auto& spans = get_span_cache();
143
144 if (spans.empty())
145 return {};
146
147 auto const_spans = spans | std::views::transform([](const auto& span) {
148 return std::span<const double>(span.data(), span.size());
149 });
150
151 auto extracted_channels = extract_group_data<double>(
152 std::vector<std::span<const double>>(const_spans.begin(), const_spans.end()),
154
155 return extracted_channels
156 | std::views::transform([](auto&& channel) {
157 return DataVariant(std::forward<decltype(channel)>(channel));
158 })
159 | std::ranges::to<std::vector>();
160}
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:102

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

+ Here is the call graph for this function: