MayaFlux 0.1.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 IO container or direct ComputeData with automatic container handling.

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

Definition at line 216 of file OperationHelper.hpp.

217 {
218 if constexpr (is_IO<T>::value) {
219 DataStructureInfo info {};
220 info.original_type = std::type_index(typeid(std::decay_t<decltype(compute_data.data)>));
221 info.dimensions = compute_data.dimensions;
222 info.modality = compute_data.modality;
223
224 if constexpr (RequiresContainer<std::decay_t<decltype(compute_data.data)>>) {
225 if (!compute_data.has_container()) {
226 throw std::runtime_error("Container is required for region-like data extraction but not provided");
227 }
228 std::vector<std::span<double>> double_data = extract_numeric_data(compute_data.data, compute_data.container.value());
229 return std::make_tuple(double_data, info);
230 } else {
231 std::vector<std::span<double>> double_data = extract_numeric_data(compute_data.data, compute_data.needs_processig());
232 return std::make_tuple(double_data, info);
233 }
234 } else {
235 DataStructureInfo info {};
236 info.original_type = std::type_index(typeid(T));
237 std::vector<std::span<double>> double_data = extract_numeric_data(compute_data);
238 auto [dimensions, modality] = infer_structure(compute_data);
239 info.dimensions = dimensions;
240 info.modality = modality;
241
242 return std::make_tuple(double_data, info);
243 }
244 }
static std::span< double > extract_numeric_data(const T &compute_data)
extract numeric data from single-variant types
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 extract_numeric_data(), MayaFlux::Yantra::infer_structure(), and MayaFlux::Yantra::DataStructureInfo::original_type.

Referenced by setup_operation_buffer(), MayaFlux::Yantra::transform_auto_correlate_fft(), MayaFlux::Yantra::transform_by_energy(), MayaFlux::Yantra::transform_channel_operation(), MayaFlux::Yantra::transform_convolve(), MayaFlux::Yantra::transform_convolve_with_fir(), MayaFlux::Yantra::transform_cross_correlate(), MayaFlux::Yantra::transform_crossfade_regions(), MayaFlux::Yantra::transform_deconvolve(), MayaFlux::Yantra::transform_delay(), MayaFlux::Yantra::transform_exponential(), MayaFlux::Yantra::transform_fade(), MayaFlux::Yantra::transform_linear(), MayaFlux::Yantra::transform_matrix(), MayaFlux::Yantra::transform_matrix_multichannel(), MayaFlux::Yantra::transform_outliers(), MayaFlux::Yantra::transform_pitch_shift(), MayaFlux::Yantra::transform_polynomial(), MayaFlux::Yantra::transform_power(), MayaFlux::Yantra::transform_regions(), MayaFlux::Yantra::transform_slice(), MayaFlux::Yantra::transform_spectral_filter(), MayaFlux::Yantra::transform_spectral_invert(), MayaFlux::Yantra::transform_time_reverse(), MayaFlux::Yantra::transform_time_stretch(), and MayaFlux::Yantra::transform_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: