MayaFlux 0.5.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 457 of file TextureContainer.cpp.

458{
459 if (layer >= m_data.size()) {
461 "TextureContainer::set_pixels(f32) layer {} out of range", layer);
462 return;
463 }
464 auto* buf = std::get_if<std::vector<float>>(&m_data[layer]);
465 if (!buf) {
467 "TextureContainer::set_pixels(f32) called on non-float format {}",
468 static_cast<int>(m_format));
469 return;
470 }
471 if (data.size() != buf->size()) {
473 "TextureContainer::set_pixels(f32) size mismatch: got {} expected {}",
474 data.size(), buf->size());
475 return;
476 }
477
478 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
479 std::ranges::copy(data, buf->begin());
480 m_normalised_dirty[layer].store(true, std::memory_order_release);
481}
#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.