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

◆ route_image()

bool MayaFlux::Kriya::BufferPipeline::route_image ( BufferOperation &  op)
private

Definition at line 91 of file BufferPipelineCapture.cpp.

92{
93 const auto source = op.m_capture.get_graphics_buffer();
94 if (!source || !has_immediate_routing(op)) {
95 return false;
96 }
97
98 const auto current = std::ranges::find_if(m_operations,
99 [&op](const BufferOperation& o) { return &o == &op; });
100 auto route = std::next(current);
101
102 if (!route->m_target_graphics_buffer || !detail::accepts_layer_write(route->m_target_graphics_buffer)) {
103 return false;
104 }
105
106 const auto image = detail::source_image(source);
107 if (!image) {
108 return false;
109 }
110
111 detail::write_layer(route->m_target_graphics_buffer, route->m_target_layer, image);
112
113 const auto route_index = static_cast<size_t>(std::distance(m_operations.begin(), route));
114 if (route_index < m_data_states.size()) {
115 m_data_states[route_index] = DataState::CONSUMED;
116 }
117
118 return true;
119}
IO::ImageData image
Definition Decoder.cpp:47
glm::vec2 current
std::vector< BufferOperation > m_operations
std::vector< DataState > m_data_states
bool has_immediate_routing(const BufferOperation &op) const
void write_layer(const std::shared_ptr< Buffers::VKBuffer > &target, uint32_t layer, const Kakshya::DataVariant &data)
Write a DataVariant into one layer of a layered buffer.
bool accepts_layer_write(const std::shared_ptr< Buffers::VKBuffer > &buffer)
Whether the buffer holds its frames as layers that can be written one at a time.
std::shared_ptr< Core::VKImage > source_image(const std::shared_ptr< Buffers::VKBuffer > &buffer)
The GPU image a buffer displays, or null when it has none to copy from.
Source source()
Begin a Source chain.
Definition Plot.hpp:127

References current, MayaFlux::Kriya::BufferCapture::get_graphics_buffer(), image, and MayaFlux::Kriya::BufferOperation::m_capture.

+ Here is the call graph for this function: