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

◆ get_variant_element_type()

std::type_index MayaFlux::Kakshya::get_variant_element_type ( const DataVariant data)

Return the native element type of a DataVariant as a type_index.

Returns typeid(E) where E is the value_type of the active alternative, consistent with NDDataContainer::value_element_type() and FrameView::element_type().

Parameters
dataSource variant.
Returns
std::type_index of the element type (e.g. typeid(uint8_t)).

Definition at line 28 of file DataUtils.cpp.

29{
30 return std::visit([](const auto& vec) -> std::type_index {
31 return typeid(typename std::decay_t<decltype(vec)>::value_type);
32 },
33 data);
34}