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

◆ pixel_bytes() [1/2]

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

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

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

Definition at line 518 of file TextureContainer.cpp.

519{
520 if (layer >= m_data.size())
521 return {};
522 ensure_cpu(layer);
523 auto [ptr, bytes] = variant_bytes_mutable(m_data[layer]);
524 return ptr ? std::span<uint8_t>(ptr, bytes) : std::span<uint8_t> {};
525}
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< uint8_t *, size_t > variant_bytes_mutable(DataVariant &v)
Get a mutable pointer to the raw bytes of a DataVariant and its size.

References ensure_cpu(), m_data, ptr, and MayaFlux::Kakshya::variant_bytes_mutable().

+ Here is the call graph for this function: