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

432{
433 if (layer >= m_data.size()) {
435 "TextureContainer::set_pixels(u16) layer {} out of range", layer);
436 return;
437 }
438 auto* buf = std::get_if<std::vector<uint16_t>>(&m_data[layer]);
439 if (!buf) {
441 "TextureContainer::set_pixels(u16) called on non-uint16 format {}",
442 static_cast<int>(m_format));
443 return;
444 }
445 if (data.size() != buf->size()) {
447 "TextureContainer::set_pixels(u16) size mismatch: got {} expected {}",
448 data.size(), buf->size());
449 return;
450 }
451
452 Memory::SeqlockWriteGuard g(m_slot_locks[layer]);
453 std::ranges::copy(data, buf->begin());
454 m_normalised_dirty[layer].store(true, std::memory_order_release);
455}
#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.