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

◆ set_pixels() [2/3]

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

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

Valid when the declared format is uint16-backed (R16/RG16/RGBA16, R16F/RG16F/RGBA16F). Size must equal width * height * channels.

Definition at line 589 of file TextureContainer.cpp.

590{
591 if (layer >= m_data.size()) {
593 "TextureContainer::set_pixels(u16) layer {} out of range", layer);
594 return;
595 }
596 auto* buf = std::get_if<std::vector<uint16_t>>(&m_data[layer]);
597 if (!buf) {
599 "TextureContainer::set_pixels(u16) called on non-uint16 format {}",
600 static_cast<int>(m_format));
601 return;
602 }
603 if (data.size() != buf->size()) {
605 "TextureContainer::set_pixels(u16) size mismatch: got {} expected {}",
606 data.size(), buf->size());
607 return;
608 }
609
610 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
611 std::ranges::copy(data, buf->begin());
612 m_normalised_dirty[layer].store(true, std::memory_order_release);
613}
#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.