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

◆ extract_region_channel()

MAYAFLUX_API std::vector< double > MayaFlux::Kakshya::extract_region_channel ( const Region region,
const std::shared_ptr< SignalSourceContainer > &  container,
uint32_t  channel 
)

Extract samples for a single channel within a Region from a container.

Slices the container's channel data by the sample range defined by region's start_coordinates[0] and end_coordinates[0] (inclusive). Uses get_region_data for the slice, then converts the requested channel variant to double. Returns an empty vector on any error (null container, channel out of range, empty region data).

This is the domain-neutral replacement for Granular::extract_grain_samples. It carries no assumption about grains, hop sizes, or granular semantics.

Parameters
regionRegion whose first coordinate pair defines the sample range.
containerSignal data source.
channelZero-based channel index.
Returns
Vector of double samples for the requested region and channel.

Definition at line 200 of file ContainerUtils.cpp.

204{
205 if (!container)
206 return {};
207
208 auto variants = container->get_region_data(region);
209
210 if (channel >= variants.size())
211 return {};
212
213 std::vector<double> storage;
214 Kakshya::extract_from_variant<double>(variants[channel], storage);
215 return storage;
216}
Eigen::MatrixXd storage
uint32_t channel

References channel, and storage.

Referenced by MayaFlux::Yantra::Granular::AttributeOp::compute_grain_attribute().

+ Here is the caller graph for this function: