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

◆ set_pixels() [1/3]

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

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

Valid when the declared format is float-backed (R32F/RG32F/RGBA32F). Size must equal width * height * channels.

Definition at line 608 of file TextureContainer.cpp.

609{
610 if (layer >= m_data.size()) {
612 "TextureContainer::set_pixels(f32) layer {} out of range", layer);
613 return;
614 }
615 claim_cpu(layer);
616 auto* buf = std::get_if<std::vector<float>>(&m_data[layer]);
617 if (!buf) {
619 "TextureContainer::set_pixels(f32) called on non-float format {}",
620 static_cast<int>(m_format));
621 return;
622 }
623 if (data.size() != buf->size()) {
625 "TextureContainer::set_pixels(f32) size mismatch: got {} expected {}",
626 data.size(), buf->size());
627 return;
628 }
629
630 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
631 std::ranges::copy(data, buf->begin());
632 m_normalised_dirty[layer].store(true, std::memory_order_release);
633}
#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: