Replace the layer's pixel buffer with a byte source.
Valid only when the declared format is uint8-backed. Size must equal width * height * bytes_per_pixel.
342{
343 if (layer >=
m_data.size()) {
345 "TextureContainer::set_pixels(u8) layer {} out of range", layer);
346 return;
347 }
348 auto* buf = std::get_if<std::vector<uint8_t>>(&
m_data[layer]);
349 if (!buf) {
351 "TextureContainer::set_pixels(u8) called on non-uint8 format {}",
353 return;
354 }
355 if (data.size() != buf->size()) {
357 "TextureContainer::set_pixels(u8) size mismatch: got {} expected {}",
358 data.size(), buf->size());
359 return;
360 }
362 std::ranges::copy(data, buf->begin());
364}
#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
std::shared_mutex m_data_mutex
std::vector< DataVariant > m_data
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.