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

◆ infer_from_container()

MAYAFLUX_API std::pair< std::vector< Kakshya::DataDimension >, Kakshya::DataModality > MayaFlux::Yantra::infer_from_container ( const std::shared_ptr< Kakshya::SignalSourceContainer > &  container)

Infer structure from SignalSourceContainer.

Definition at line 29 of file StructureIntrospection.cpp.

30{
31 if (!container) {
32 error<std::invalid_argument>(Journal::Component::Yantra, Journal::Context::Runtime, std::source_location::current(),
33 "Cannot infer structure from null container");
34 }
35
36 const auto& structure = container->get_structure();
37 auto dimensions = structure.dimensions;
38
39 auto modality = structure.modality;
40 if (modality == Kakshya::DataModality::UNKNOWN) {
41 modality = Kakshya::detect_data_modality(dimensions);
42 }
43
44 if (dimensions.empty()) {
45 auto total_elements = structure.get_total_elements();
46 if (total_elements > 0) {
47 dimensions.emplace_back(Kakshya::DataDimension::time(total_elements));
48 modality = Kakshya::DataModality::AUDIO_1D;
49 }
50 }
51
52 return std::make_pair(std::move(dimensions), modality);
53}

References MayaFlux::Kakshya::AUDIO_1D, MayaFlux::Kakshya::detect_data_modality(), MayaFlux::Journal::Runtime, MayaFlux::Kakshya::DataDimension::time(), MayaFlux::Kakshya::UNKNOWN, and MayaFlux::Journal::Yantra.

Referenced by infer_from_region(), and infer_structure().

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