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

◆ extract_numeric_data() [1/3]

template<typename T>
requires SingleVariant<T>
NumericChannels MayaFlux::Yantra::OperationHelper::extract_numeric_data ( const T & compute_data)
inlinestatic

extract numeric data from single-variant types

Template Parameters
TComputeData type
Parameters
compute_dataInput data
Returns
One channel of double data. A DataVariant is viewed in place; other types are converted into storage the result owns.

Definition at line 290 of file OperationHelper.hpp.

291 {
292 if constexpr (std::is_same_v<T, Kakshya::DataVariant>) {
293 return NumericChannels { NumericChannels::Spans { Kakshya::convert_variant<double>(compute_data, s_complex_strategy) } };
294 } else if constexpr (is_eigen_matrix_v<T>) {
295 return owned_channel(create_data_variant_from_eigen(compute_data));
296 } else {
297 return owned_channel(Kakshya::DataVariant { compute_data });
298 }
299 }
std::vector< std::span< double > > Spans
static Kakshya::ComplexConversionStrategy s_complex_strategy
static NumericChannels owned_channel(Kakshya::DataVariant data)
One channel of a single variant, converted to double and kept alive by the result.
static Kakshya::DataVariant create_data_variant_from_eigen(const EigenType &eigen_data)
Create DataVariant from Eigen matrix/vector.
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:58
std::span< T > convert_variant(DataVariant &variant, ComplexConversionStrategy strategy=ComplexConversionStrategy::MAGNITUDE)
Get const span from DataVariant without conversion (zero-copy for matching types).
constexpr bool is_eigen_matrix_v
Definition DataSpec.hpp:39

References MayaFlux::Kakshya::convert_variant(), create_data_variant_from_eigen(), MayaFlux::Yantra::is_eigen_matrix_v, owned_channel(), and s_complex_strategy.

Referenced by extract_structured_double(), MayaFlux::Yantra::generate_compute_data_indices(), MayaFlux::Yantra::StandardSorter< std::vector< Kakshya::DataVariant > >::merge_chunks_to_result(), MayaFlux::Yantra::sort_compute_data_inplace(), MayaFlux::Yantra::transform_regions(), MayaFlux::Yantra::transform_regions(), MayaFlux::Yantra::FeatureExtractor< std::vector< Kakshya::DataVariant >, std::vector< std::vector< double > > >::validate_extraction_input(), and MayaFlux::Yantra::Transformer< InputType, OutputType >::validate_input().

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