#pragma once #ifndef NOMINMAX #define NOMINMAX #endif #include #include #include #include #include #include namespace XCEngine::UI::Editor::Host { class D3D12WindowRenderer; class D3D12WindowCapture { public: bool CaptureCurrentBackBufferToPng( const D3D12WindowRenderer& windowRenderer, const std::filesystem::path& outputPath, std::string& outError); void Shutdown(); private: bool EnsureWicFactory(std::string& outError); bool EncodePng( const std::filesystem::path& outputPath, const std::uint8_t* pixels, UINT width, UINT height, UINT rowPitch, REFWICPixelFormatGUID pixelFormat, std::string& outError) const; Microsoft::WRL::ComPtr m_wicFactory = {}; bool m_wicComInitialized = false; }; } // namespace XCEngine::UI::Editor::Host