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

◆ on_attach()

void MayaFlux::Kakshya::WindowAccessProcessor::on_attach ( const std::shared_ptr< SignalSourceContainer > &  container)
overridevirtual

Attach to a WindowContainer.

Queries the live swapchain format and caches surface traits. Throws std::invalid_argument if container is not a WindowContainer.

Implements MayaFlux::Kakshya::DataProcessor.

Definition at line 13 of file WindowAccessProcessor.cpp.

15{
16 auto wc = std::dynamic_pointer_cast<WindowContainer>(container);
17 if (!wc) {
18 error<std::invalid_argument>(
21 std::source_location::current(),
22 "WindowAccessProcessor requires a WindowContainer");
23 }
24
25 const auto& s = wc->get_structure();
26 m_width = static_cast<uint32_t>(s.get_width());
27 m_height = static_cast<uint32_t>(s.get_height());
28
29 m_surface_format = query_surface_format(wc->get_window());
30
31 const uint32_t bpp = Core::vk_format_bytes_per_pixel(
33
34 container->mark_ready_for_processing(true);
35
37 "WindowAccessProcessor attached: {}x{} format={} bpp={}",
39 static_cast<uint32_t>(m_surface_format),
40 bpp);
41}
#define MF_INFO(comp, ctx,...)
Core::GraphicsSurfaceInfo::SurfaceFormat m_surface_format
vk::Format to_vk_format(GraphicsSurfaceInfo::SurfaceFormat fmt)
uint32_t vk_format_bytes_per_pixel(vk::Format fmt)
Byte width of a single pixel for a given Vulkan format.
@ ContainerProcessing
Container operations (Kakshya - file/stream/region processing)
@ Kakshya
Containers[Signalsource, Stream, File], Regions, DataProcessors.
Core::GraphicsSurfaceInfo::SurfaceFormat query_surface_format(const std::shared_ptr< Core::Window > &window)
Query the actual vk::Format in use by the window's live swapchain, translated back to the MayaFlux su...

References MayaFlux::Journal::ContainerProcessing, MayaFlux::Journal::Kakshya, m_height, m_surface_format, m_width, MF_INFO, MayaFlux::Kakshya::query_surface_format(), MayaFlux::Core::to_vk_format(), and MayaFlux::Core::vk_format_bytes_per_pixel().

+ Here is the call graph for this function: