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

◆ extract_structured_double()

template<OperationReadyData T>
static std::tuple< std::vector< std::span< double > >, DataStructureInfo > MayaFlux::Yantra::OperationHelper::extract_structured_double ( T &  compute_data)
inlinestatic

Extract structured double data from Datum container or direct ComputeData with automatic container handling.

Template Parameters
TOperationReadyData type
Parameters
compute_dataor Datum container with data and optional container
Returns
Tuple of [spans, structure_info]
Exceptions
std::runtime_errorif container required but not provided

Definition at line 343 of file OperationHelper.hpp.

344 {
345 if constexpr (is_IO<T>::value) {
346 DataStructureInfo info {};
347 info.original_type = std::type_index(typeid(std::decay_t<decltype(compute_data.data)>));
348 info.dimensions = compute_data.dimensions;
349 info.modality = compute_data.modality;
350
351 if constexpr (RequiresContainer<std::decay_t<decltype(compute_data.data)>>) {
352 if (!compute_data.has_container()) {
353 error<std::runtime_error>(Journal::Component::Yantra, Journal::Context::ContainerProcessing, std::source_location::current(), "Container is required for region-like data extraction but not provided");
354 }
355 std::vector<std::span<double>> double_data = extract_numeric_data(compute_data.data, compute_data.container.value());
356 return std::make_tuple(double_data, info);
357 } else {
358 std::vector<std::span<double>> double_data = extract_numeric_data(compute_data.data, compute_data.needs_processig());
359 return std::make_tuple(double_data, info);
360 }
361 } else {
362 DataStructureInfo info {};
363 info.original_type = std::type_index(typeid(T));
364 std::vector<std::span<double>> double_data = extract_numeric_data(compute_data);
365 auto [dimensions, modality] = infer_structure(compute_data);
366 info.dimensions = dimensions;
367 info.modality = modality;
368
369 return std::make_tuple(double_data, info);
370 }
371 }
static std::span< double > extract_numeric_data(const T &compute_data)
extract numeric data from single-variant types
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
static std::pair< std::vector< Kakshya::DataDimension >, Kakshya::DataModality > infer_structure(const T &data, const std::shared_ptr< Kakshya::SignalSourceContainer > &container=nullptr)
Infer dimensions and modality from any ComputeData type.

References MayaFlux::Yantra::DataStructureInfo::original_type.

Referenced by MayaFlux::Yantra::EnergyAnalyzer< InputType, OutputType >::analyze_implementation(), MayaFlux::Yantra::StatisticalAnalyzer< InputType, OutputType >::analyze_implementation(), MayaFlux::Yantra::ConvolutionTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::MathematicalTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::SpectralTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::TemporalTransformer< InputType, OutputType >::apply_per_channel(), MayaFlux::Yantra::ConvolutionTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::MathematicalTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::SpectralTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::TemporalTransformer< InputType, OutputType >::create_output(), MayaFlux::Yantra::FeatureExtractor< InputType, OutputType >::extract_implementation(), MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType >::extract_inputs(), MayaFlux::Yantra::StandardSorter< InputType, OutputType >::sort_chunked(), MayaFlux::Yantra::transform_by_energy(), MayaFlux::Yantra::transform_channel_operation(), MayaFlux::Yantra::transform_crossfade_regions(), MayaFlux::Yantra::transform_matrix(), MayaFlux::Yantra::transform_matrix_multichannel(), MayaFlux::Yantra::transform_outliers(), and MayaFlux::Yantra::transform_regions().

+ Here is the caller graph for this function: