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

◆ as_uint16()

std::span< const uint16_t > MayaFlux::Kakshya::TextureContainer::as_uint16 ( uint32_t  layer = 0) const

Typed view over the uint16 variant.

Returns an empty span if the layer's variant is not uint16. 16-bit UNORM formats and half-float formats both reside here; for half-float, the uint16 bits are the IEEE-754 binary16 encoding.

Definition at line 325 of file TextureContainer.cpp.

326{
327 if (layer >= m_data.size())
328 return {};
329 const auto* v = std::get_if<std::vector<uint16_t>>(&m_data[layer]);
330 return v ? std::span<const uint16_t>(v->data(), v->size()) : std::span<const uint16_t> {};
331}