MayaFlux 0.2.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 145 of file SoundStreamContainer.cpp.

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