Skip to main content
API Reference NSDK PlaybackDataset

FrameMetadata

Frame metadata structure matching the JSON format. Required fields per capture.json spec; optional fields may be omitted.

Declaration

struct FrameMetadata

Constructors

init(from decoder: any Decoder) throws

Summary

Creates a new instance by decoding from the given decoder.
This initializer throws an error if reading from the decoder fails, or
if the data read is corrupted or otherwise invalid.
- Parameter decoder: The decoder to read data from.


Properties

NameTypeSummary
var cameraImageHeightUInt32
Camera image height in pixels (second element of resolution array).
var cameraImageWidthUInt32
Camera image width in pixels (first element of resolution array).
var cameraIntrinsicssimd_float3x3
Converts the frame's intrinsics array (at least 5 elements: fx, fy, cx, cy, s) into a 3×3 pinhole intrinsics matrix.
Layout is [fx, 0, 0; 0, fy, 0; cx, cy, 1]. The 5th parameter (skew/distortion) is not used in the matrix.
Returns zero matrix if the array has fewer than 5 elements.
var cameraTimestampMsUInt64
Frame timestamp in milliseconds (from metadata timestamp × 1000).
var cameraTransformsimd_float4x4
Converts the frame's pose4x4 array (16 floats, column-major) into a simd_float4x4 camera-to-world transform.
Returns zero matrix if the array does not have exactly 16 elements.
var compassDataNSDKFrameData.CompassData
Builds NsdkFrameData.CompassData from the frame's location metadata when heading data is present; otherwise nil.
let depthString?
-
let depthConfidenceString?
-
let depthResolution [Int]?
-
let depthTimestampDouble?
-
var gpsDataNSDKFrameData.GpsData
Builds NsdkFrameData.GpsData when location and latitude/longitude are present; otherwise nil. Uses 0 for other missing fields.
let imageString
-
let intrinsics [Double]
-
let locationLocationMetadata?
-
var nsdkCameraIntrinsicsNSDKFrameData.CameraIntrinsics
Builds NSDKFrameData.CameraIntrinsics (intrinsics matrix plus width/height) for passing to the native SDK.
var orientationUIInterfaceOrientation
Converts the frame's screen orientation string (e.g. "portrait", "landscapeleft") to UIInterfaceOrientation.
Used to know how the recording was held so viewport and projection can match. Returns nil if metadata has no orientation.
let pose [Double]
-
let pose4x4 [Double]
-
let projection [Double]?
-
let resolution [Int]
-
let saveDurationDouble?
-
let screenOrientationString?
-
let sequenceInt
-
let timestampDouble
-
let trackingInt
-
let trackingReasonInt?
-
var trackingStateARCamera.TrackingState
Converts the frame's tracking state integer from the dataset into ARCamera.TrackingState.
Allows playback code to use the same tracking API as live AR. Mapping matches Unity ARFoundation:
0 → notAvailable, 1 → limited(insufficientFeatures), 2 (or other) → normal.

Relationships

conforms to: Swift.Encodable
conforms to: Swift.Decodable