MayaFlux 0.4.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 366 of file TextureContainer.cpp.

367{
368 if (layer >= m_data.size()) {
370 "TextureContainer::set_pixels(u16) layer {} out of range", layer);
371 return;
372 }
373 auto* buf = std::get_if<std::vector<uint16_t>>(&m_data[layer]);
374 if (!buf) {
376 "TextureContainer::set_pixels(u16) called on non-uint16 format {}",
377 static_cast<int>(m_format));
378 return;
379 }
380 if (data.size() != buf->size()) {
382 "TextureContainer::set_pixels(u16) size mismatch: got {} expected {}",
383 data.size(), buf->size());
384 return;
385 }
386 std::unique_lock lock(m_data_mutex);
387 std::ranges::copy(data, buf->begin());
388 m_processed_data[layer] = m_data[layer];
389}
#define MF_ERROR(comp, ctx,...)
void lock() override
Acquire a lock for thread-safe access.
Portal::Graphics::ImageFormat m_format
std::vector< DataVariant > m_processed_data
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.

References MF_ERROR.