NSDKDepthSession
Depth feature session for NSDK with Combine publisher support....
Declaration
final class NSDKDepthSessionSummary
Depth feature session for NSDK with Combine publisher support.
Upon starting the depth session, NSDK will begin processing AR frames to generate depth data.
The latest depth data can be retrieved using latestDepth(), and latestImageParams()
provides information to synchronize the depth image with camera frame.
$result is refreshed automatically each frame by NSDKSession.update() while the session
is active. Subscribe to it with Combine:
depthSession.$result
.compactMap { if case .success(let result) = $0 { return result } else { return nil } }
.sink { result in ... }
.store(in: &cancellables)
Properties
| Name | Type | Summary |
|---|---|---|
| @Published var result | NSDKAsyncState<DepthResult, AwarenessError |
Methods
| Name | Type | Summary |
|---|---|---|
| configure | void | Configures the session with the specified settings. - Attention: This method must be called while the session is stopped, or else configuration will fail. In that case, while this function returns without throwing, configuration will still fail asynchronously. Use featureStatus()to check that configuration has not failed. - Parameter config: An object that defines this session's behavior. Only settings that differ from the defaults will be applied. - Throws: NSDKError.invalidArgument if the configuration is invalid.Check NSDK's C logs for more information. |
| featureStatus | NSDKFeatureStatus | The current feature status of the depth session. |
| latestDepth | NSDKAsyncState<DepthResult, AwarenessError> | Retrieves the latest depth result from the depth session. - Returns: An NSDKAsyncState containing either the latest DepthResult,or an AwarenessError. |
| latestImageParams | NSDKAsyncState<AwarenessImageParams, AwarenessError> | Retrieves the latest image parameters associated with the depth data. - Returns: An NSDKAsyncState containing either the latest AwarenessImageParams,or an AwarenessError. |
| start | void | Starts the depth session, enabling depth data processing with the current configuration. |
| stop | void | Stops the depth session, halting depth data processing. |
Nested Types
Structs
| Name | Type | Summary |
|---|---|---|
| Configuration | Configuration | The type of configuration used by this session |
Enums
| Name | Type | Summary |
|---|---|---|
| DepthMode | DepthMode | Options for different depth sensing modes. These trade off between performance and quality. |
Relationships
conforms to: NSDKFeatureSession
NSDKSessionwhile active.