From b918dc278b2386c68d040ee752f6f685962ebad6 Mon Sep 17 00:00:00 2001 From: Georg Hagen Date: Wed, 31 Jul 2024 22:22:40 +0200 Subject: [PATCH] Expose additional AR capabilities --- openVulkanoCpp/AR/ArSession.hpp | 10 ++++++++-- openVulkanoCpp/AR/Provider/ArKit/ArSessionArKit.mm | 2 +- .../AR/Provider/Playback/ArSessionPlayback.cpp | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/openVulkanoCpp/AR/ArSession.hpp b/openVulkanoCpp/AR/ArSession.hpp index 5a47143..616b623 100644 --- a/openVulkanoCpp/AR/ArSession.hpp +++ b/openVulkanoCpp/AR/ArSession.hpp @@ -45,16 +45,22 @@ namespace OpenVulkano::AR ArSessionType sessionType = ArSessionType::NATIVE; bool uncompressed = true; bool depthSupported = false; + bool supportsExposureLocking = false; + bool supportsWhitebalanceLocking = false; + bool hasFlashlight = false; public: ArSessionCapabilities() = default; - ArSessionCapabilities(const ArType type, const ArSessionType sessionType, const bool uncompressed, const bool depthSupported) - : type(type), sessionType(sessionType), uncompressed(uncompressed), depthSupported(depthSupported) + ArSessionCapabilities(const ArType type, const ArSessionType sessionType, const bool uncompressed, const bool depthSupported, const bool supportsExposureLocking, const bool suppoertWhitebalanceLocking, const bool hasFlash) + : type(type), sessionType(sessionType), uncompressed(uncompressed), depthSupported(depthSupported), supportsExposureLocking(supportsExposureLocking), supportsWhitebalanceLocking(supportsWhitebalanceLocking), hasFlashlight(hasFlash) {} [[nodiscard]] bool IsUncompressed() const { return uncompressed; } [[nodiscard]] bool IsDepthSupported() const { return depthSupported; } + [[nodiscard]] bool IsExposureLockSupported() const { return supportsExposureLocking; } + [[nodiscard]] bool IsWhitebalanceLockSupported() const { return supportsWhitebalanceLocking; } + [[nodiscard]] bool HasFlashlight() const { return hasFlashlight; } [[nodiscard]] bool IsNative() const { return sessionType == ArSessionType::NATIVE; } [[nodiscard]] bool IsPlayback() const { return sessionType == ArSessionType::PLAYBACK; } [[nodiscard]] bool IsStream() const { return sessionType == ArSessionType::NETWORK_STREAM; } diff --git a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKit.mm b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKit.mm index d9fb276..f1f75ed 100644 --- a/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKit.mm +++ b/openVulkanoCpp/AR/Provider/ArKit/ArSessionArKit.mm @@ -14,7 +14,7 @@ namespace OpenVulkano::AR::ArKit ArSessionCapabilities QueryNativeCapabilities() { bool supportsDepth = [ARWorldTrackingConfiguration supportsFrameSemantics:ARFrameSemanticSceneDepth]; - ArSessionCapabilities capabilities(ArType::AR_KIT, ArSessionType::NATIVE, true, supportsDepth); + ArSessionCapabilities capabilities(ArType::AR_KIT, ArSessionType::NATIVE, true, supportsDepth, true, true, true); return capabilities; } } diff --git a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp index 47fd852..480708e 100644 --- a/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp +++ b/openVulkanoCpp/AR/Provider/Playback/ArSessionPlayback.cpp @@ -17,7 +17,7 @@ namespace OpenVulkano::AR::Playback ArSessionPlayback::ArSessionPlayback(const std::string& recordingPath, bool autoAdvance) : ArSession(ArSessionMetadata(recordingPath)), recordingPath(recordingPath), autoAdvance(autoAdvance), playbackReader(recordingPath) { - capabilities = ArSessionCapabilities(metadata.type, ArSessionType::PLAYBACK, false, metadata.depthFormat != ArDepthFormat::UNAVAILABLE); + capabilities = ArSessionCapabilities(metadata.type, ArSessionType::PLAYBACK, false, metadata.depthFormat != ArDepthFormat::UNAVAILABLE, false, false, false); constants = { Math::Matrix4f(1), metadata.confidenceRange }; m_playbackReaderThread = std::thread([this](){ReadWorker();});