Download pixel data from a VKImage into this container.
Blocking. Overwrites the existing pixel buffer. Does not change declared width, height, or format — caller must ensure consistency.
234{
237 "TextureContainer::from_image called with uninitialised image");
238 return;
239 }
240
241 if (layer >=
m_data.size()) {
243 "TextureContainer::from_image layer {} out of range ({})", layer,
m_data.size());
244 return;
245 }
246
248
251
252 auto [ptr, bytes] = variant_bytes_mut(
m_data[layer]);
253 if (!ptr || bytes != sz) {
255 "TextureContainer::from_image variant size mismatch ({} vs {})", bytes, sz);
256 return;
257 }
258
260
261 {
264 }
265
267
269 "TextureContainer: downloaded {} bytes from VKImage", sz);
270}
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
void lock() override
Acquire a lock for thread-safe access.
void update_processing_state(ProcessingState state) override
Update the processing state of the container.
Portal::Graphics::ImageFormat m_format
std::vector< DataVariant > m_processed_data
std::shared_mutex m_data_mutex
std::vector< DataVariant > m_data
size_t byte_size() const
Total byte count of the pixel buffer.
static TextureLoom & instance()
void download_data(const std::shared_ptr< Core::VKImage > &image, void *data, size_t size)
Download pixel data from a texture.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
@ READY
Container has data loaded and is ready for processing.