FrameMetadata
Frame metadata structure matching the JSON format. Required fields per capture.json spec; optional fields may be omitted.
Declaration
struct FrameMetadataConstructors
init(from decoder: any Decoder) throws
Summary
Properties
| Name | Type | Summary |
|---|---|---|
| var cameraImageHeight | UInt32 | Camera image height in pixels (second element of resolution array). |
| var cameraImageWidth | UInt32 | Camera image width in pixels (first element of resolution array). |
| var cameraIntrinsics | simd_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 cameraTimestampMs | UInt64 | Frame timestamp in milliseconds (from metadata timestamp × 1000). |
| var cameraTransform | simd_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 compassData | NSDKFrameData.CompassData | Builds NsdkFrameData.CompassData from the frame's location metadata when heading data is present; otherwise nil. |
| let depth | String? | - |
| let depthConfidence | String? | - |
| let depthResolution | [Int]? | - |
| let depthTimestamp | Double? | - |
| var gpsData | NSDKFrameData.GpsData | Builds NsdkFrameData.GpsData when location and latitude/longitude are present; otherwise nil. Uses 0 for other missing fields. |
| let image | String | - |
| let intrinsics | [Double] | - |
| let location | LocationMetadata? | - |
| var nsdkCameraIntrinsics | NSDKFrameData.CameraIntrinsics | Builds NSDKFrameData.CameraIntrinsics (intrinsics matrix plus width/height) for passing to the native SDK. |
| var orientation | UIInterfaceOrientation | 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 saveDuration | Double? | - |
| let screenOrientation | String? | - |
| let sequence | Int | - |
| let timestamp | Double | - |
| let tracking | Int | - |
| let trackingReason | Int? | - |
| var trackingState | ARCamera.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
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.