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

◆ set_pixels() [3/3]

void MayaFlux::Kakshya::TextureContainer::set_pixels ( std::span< const uint8_t >  data,
uint32_t  layer = 0 
)

Replace the layer's pixel buffer with a byte source.

Valid only when the declared format is uint8-backed. Size must equal width * height * bytes_per_pixel.

Definition at line 405 of file TextureContainer.cpp.

406{
407 if (layer >= m_data.size()) {
409 "TextureContainer::set_pixels(u8) layer {} out of range", layer);
410 return;
411 }
412 auto* buf = std::get_if<std::vector<uint8_t>>(&m_data[layer]);
413 if (!buf) {
415 "TextureContainer::set_pixels(u8) called on non-uint8 format {}",
416 static_cast<int>(m_format));
417 return;
418 }
419 if (data.size() != buf->size()) {
421 "TextureContainer::set_pixels(u8) size mismatch: got {} expected {}",
422 data.size(), buf->size());
423 return;
424 }
425
426 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
427 std::ranges::copy(data, buf->begin());
428 m_normalised_dirty[layer].store(true, std::memory_order_release);
429}
#define MF_ERROR(comp, ctx,...)
std::vector< std::atomic< bool > > m_normalised_dirty
Portal::Graphics::ImageFormat m_format
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References MF_ERROR.