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

392{
393 if (layer >= m_data.size()) {
395 "TextureContainer::set_pixels(f32) layer {} out of range", layer);
396 return;
397 }
398 auto* buf = std::get_if<std::vector<float>>(&m_data[layer]);
399 if (!buf) {
401 "TextureContainer::set_pixels(f32) called on non-float format {}",
402 static_cast<int>(m_format));
403 return;
404 }
405 if (data.size() != buf->size()) {
407 "TextureContainer::set_pixels(f32) size mismatch: got {} expected {}",
408 data.size(), buf->size());
409 return;
410 }
411 std::unique_lock lock(m_data_mutex);
412 std::ranges::copy(data, buf->begin());
413 m_processed_data[layer] = m_data[layer];
414}
#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.