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

◆ value_element_type()

std::type_index MayaFlux::Kakshya::TextureContainer::value_element_type ( ) const
overridevirtual

Runtime query for the native scalar element type of this container.

Mirrors FrameView::element_type(). Typical return values:

  • typeid(uint8_t) – 8-bit image / video / window
  • typeid(uint16_t) – 16-bit image
  • typeid(float) – HDR image
  • typeid(double) – audio / plot

Use this to branch once before calling get_value_at<ValueT>() when the container's native type is not statically known at the call site.

Implements MayaFlux::Kakshya::NDDataContainer< DataVariant >.

Definition at line 793 of file TextureContainer.cpp.

794{
795 size_t element_size = storage_element_size(m_format);
796 if (element_size == 1) {
797 return typeid(uint8_t);
798 }
799 if (element_size == 2) {
800 return typeid(uint16_t);
801 }
802 if (element_size == 4) {
803 return typeid(float);
804 }
805
806 return typeid(uint8_t);
807}
size_t storage_element_size(ImageFormat format)
Byte width of the DataVariant element backing a given ImageFormat.

References m_format, and MayaFlux::Kakshya::storage_element_size().

+ Here is the call graph for this function: