From 9db2db918325c2ec556c7b42eafa374debd35605 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Sat, 29 Jul 2023 00:53:11 +0200 Subject: [PATCH] Add ArKit HighRes capture --- .../Provider/ArKit/ArSessionArKitInternal.mm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm index 165b9fa..c950528 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm +++ b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKitInternal.mm @@ -81,7 +81,24 @@ namespace openVulkanoCpp::AR::ArKit void ArSessionArKitInternal::RequestHighResolutionFrame() { - Logger::AR->error("Failed to perform high resolution still frame capture: not supported on this platform!"); + if (@available(iOS 16.0, *)) { + [m_arSession captureHighResolutionFrameWithCompletion:^(ARFrame * _Nullable frame, NSError * _Nullable error) { + if (frame) + { + std::shared_ptr arFrame = std::make_shared(frame, shared_from_this()); + arFrame->MarkHighRes(); + OnNewFrameHighResolution(arFrame); + } + else + { + Logger::AR->warn("Failed to perform high resolution still frame capture: {}", [[error description] UTF8String]); + } + }]; + } + else + { + Logger::AR->warn("Failed to perform high resolution still frame capture: requires iOS 16 or later!"); + } }