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

◆ pixel_bytes() [2/2]

std::span< const uint8_t > MayaFlux::Kakshya::TextureContainer::pixel_bytes ( uint32_t  layer = 0) const

Read-only byte-level view over the pixel buffer.

The returned span covers the raw byte footprint of the layer, regardless of the underlying variant type. For uint8 formats this is the natural view; for uint16 and float formats the caller can reinterpret_cast for typed access, or prefer the as_uint16 / as_float accessors below.

Parameters
layerArray layer index for array textures (default 0).

Definition at line 365 of file TextureContainer.cpp.

366{
367 if (layer >= m_data.size())
368 return {};
369 auto [ptr, bytes] = variant_bytes(m_data[layer]);
370 return ptr ? std::span<const uint8_t>(ptr, bytes) : std::span<const uint8_t> {};
371}
const uint8_t * ptr
std::pair< const uint8_t *, size_t > variant_bytes(const DataVariant &v)
Get a pointer to the raw bytes of a DataVariant and its size.
Definition DataUtils.cpp:95

References ptr, and MayaFlux::Kakshya::variant_bytes().

Referenced by MayaFlux::Portal::Text::rasterize_quads().

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