Add ArKit HighRes capture

This commit is contained in:
2023-07-29 00:53:11 +02:00
parent 13cefdf9f8
commit 9db2db9183

View File

@@ -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> arFrame = std::make_shared<ArFrameArKit>(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!");
}
}