MayaFlux 1.0.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 509 of file TextureContainer.cpp.

510{
511 if (layer >= m_data.size())
512 return {};
513 ensure_cpu(layer);
514 auto [ptr, bytes] = variant_bytes(m_data[layer]);
515 return ptr ? std::span<const uint8_t>(ptr, bytes) : std::span<const uint8_t> {};
516}
const uint8_t * ptr
void ensure_cpu(uint32_t layer) const
Download a GPU-held layer into m_data before a CPU read.
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 ensure_cpu(), m_data, ptr, and MayaFlux::Kakshya::variant_bytes().

Referenced by MayaFlux::Portal::Text::rasterize_quads(), and MayaFlux::Portal::Text::AtlasImage::sync().

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