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

◆ read_host_pixels()

void MayaFlux::Buffers::DataReadProcessor::read_host_pixels ( )

Read the host pixel data a TextureBuffer retains.

Definition at line 199 of file DataReadProcessor.cpp.

200{
201 arm([](DataReadProcessor&, const std::shared_ptr<VKBuffer>& vk, PendingRead& pending) {
202 const auto texture = std::dynamic_pointer_cast<TextureBuffer>(vk);
203 if (!texture || texture->get_pixel_data().empty()) {
205 "DataReadProcessor requires host pixel data for a host pixel read");
206 return false;
207 }
208
209 const auto format = texture->get_format();
210 pending.image = Kakshya::ImageData::from_bytes(
211 texture->get_width(), texture->get_height(),
213 format, texture->get_pixel_data());
214 if (!pending.image) {
216 "DataReadProcessor host pixel data does not match the texture's format and size");
217 return false;
218 }
219 return true;
220 });
221}
#define MF_RT_ERROR(comp, ctx,...)
bool format
static uint32_t get_channel_count(ImageFormat format)
Get the number of color channels for a given format.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
static std::optional< ImageData > from_bytes(uint32_t width, uint32_t height, uint32_t channels, ImageFormat format, std::span< const uint8_t > bytes)
Build an ImageData from raw pixel bytes in format's layout.
Definition ImageData.cpp:57

References arm(), MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, format, MayaFlux::Kakshya::ImageData::from_bytes(), MayaFlux::Portal::Graphics::TextureLoom::get_channel_count(), MayaFlux::Buffers::DataReadProcessor::PendingRead::image, and MF_RT_ERROR.

Referenced by MayaFlux::Kriya::detail::arm_graphics_read().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: