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 563 of file TextureContainer.cpp.

564{
565 if (layer >= m_data.size()) {
567 "TextureContainer::set_pixels(u8) layer {} out of range", layer);
568 return;
569 }
570 auto* buf = std::get_if<std::vector<uint8_t>>(&m_data[layer]);
571 if (!buf) {
573 "TextureContainer::set_pixels(u8) called on non-uint8 format {}",
574 static_cast<int>(m_format));
575 return;
576 }
577 if (data.size() != buf->size()) {
579 "TextureContainer::set_pixels(u8) size mismatch: got {} expected {}",
580 data.size(), buf->size());
581 return;
582 }
583
584 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
585 std::ranges::copy(data, buf->begin());
586 m_normalised_dirty[layer].store(true, std::memory_order_release);
587}
#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.