MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ write_pixels()

void MayaFlux::Buffers::DataWriteProcessor::write_pixels ( Kakshya::ImageData  image)

Write the retained host pixels of the attached TextureBuffer.

The image must match the texture's format and size. The buffer re-uploads to its GPU image on its own cycle.

Definition at line 159 of file DataWriteProcessor.cpp.

160{
161 auto payload = std::make_shared<Kakshya::ImageData>(std::move(image));
162 enqueue_write([payload](DataWriteProcessor&, const std::shared_ptr<VKBuffer>& vk) {
163 const auto texture = std::dynamic_pointer_cast<TextureBuffer>(vk);
164 if (!texture || payload->format != texture->get_format()
165 || payload->width != texture->get_width() || payload->height != texture->get_height()
166 || !payload->is_consistent()) {
168 "DataWriteProcessor write_pixels needs a TextureBuffer and an image of its format and size");
169 return;
170 }
171 texture->set_pixel_data(payload->data(), payload->byte_size());
172 });
173}
#define MF_RT_ERROR(comp, ctx,...)
uint64_t payload
Definition Composite.cpp:18
IO::ImageData image
Definition Decoder.cpp:47
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, enqueue_write(), image, MF_RT_ERROR, and payload.

+ Here is the call graph for this function: