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

582{
583 if (layer >= m_data.size()) {
585 "TextureContainer::set_pixels(u16) layer {} out of range", layer);
586 return;
587 }
588 claim_cpu(layer);
589 auto* buf = std::get_if<std::vector<uint16_t>>(&m_data[layer]);
590 if (!buf) {
592 "TextureContainer::set_pixels(u16) called on non-uint16 format {}",
593 static_cast<int>(m_format));
594 return;
595 }
596 if (data.size() != buf->size()) {
598 "TextureContainer::set_pixels(u16) size mismatch: got {} expected {}",
599 data.size(), buf->size());
600 return;
601 }
602
603 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
604 std::ranges::copy(data, buf->begin());
605 m_normalised_dirty[layer].store(true, std::memory_order_release);
606}
#define MF_ERROR(comp, ctx,...)
std::vector< std::atomic< bool > > m_normalised_dirty
void claim_cpu(uint32_t layer)
Give a GPU-held layer fresh CPU storage before a full overwrite.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References claim_cpu(), MayaFlux::Journal::ContainerProcessing, MayaFlux::Journal::Kakshya, m_data, m_format, m_normalised_dirty, m_slot_locks, and MF_ERROR.

+ Here is the call graph for this function: