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

◆ as()

template<DataVariantElement T>
std::span< const T > MayaFlux::Kakshya::FrameView::as ( ) const
inline

Return a typed span over the frame data without conversion.

Returns an empty span if T does not match the native element type. Callers should query element_type() first when the type is not statically known. The returned span is valid only for the lifetime of the owning container's frame buffer.

Template Parameters
TElement type. Must satisfy DataVariantElement.
Returns
Span of const T, empty on type mismatch.

Return a typed span over the frame data without conversion or allocation.

Returns an empty span if T does not match the native element type. No exception is thrown on mismatch; check empty() or call element_type() first when the container type is not statically known.

The returned span aliases the container's internal buffer directly. See class-level lifetime and threading notes.

Template Parameters
TElement type. Must satisfy DataVariantElement.
Returns
Span of const T into live storage, empty on type mismatch.

Definition at line 691 of file NDData.hpp.

692 {
693 const auto* s = std::get_if<std::span<const T>>(&m_span);
694 return s ? *s : std::span<const T> {};
695 }

References m_span.