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

◆ infer_from_segments()

std::pair< std::vector< Kakshya::DataDimension >, Kakshya::DataModality > MayaFlux::Yantra::infer_from_segments ( const std::vector< Kakshya::RegionSegment > &  segments,
const std::shared_ptr< Kakshya::SignalSourceContainer > &  container 
)

Infer structure from RegionSegments.

Definition at line 86 of file StructureIntrospection.cpp.

87{
88 if (segments.empty() || !container) {
89 return { { { Kakshya::DataDimension::time(0) } }, Kakshya::DataModality::UNKNOWN };
90 }
91
92 bool consistent_coords = std::ranges::all_of(segments,
93 [&](const auto& seg) {
94 return seg.source_region.end_coordinates.size() == segments[0].source_region.end_coordinates.size();
95 });
96
97 if (consistent_coords) {
98 return infer_from_region(segments[0].source_region, container);
99 }
100
101 auto max_coord_segment = std::ranges::max_element(segments,
102 [](const auto& a, const auto& b) {
103 return a.source_region.end_coordinates.size() < b.source_region.end_coordinates.size();
104 });
105 return infer_from_region(max_coord_segment->source_region, container);
106}
size_t a
size_t b
std::pair< std::vector< Kakshya::DataDimension >, Kakshya::DataModality > infer_from_region(const Kakshya::Region &region, const std::shared_ptr< Kakshya::SignalSourceContainer > &container)
Infer structure from Region (placeholder since regions are markers)

References a, b, infer_from_region(), MayaFlux::Kakshya::DataDimension::time(), and MayaFlux::Kakshya::UNKNOWN.

Referenced by infer_structure().

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