ARFrame¶
Inherits: RefCounted < Object
Contains per-frame AR data including camera pose, anchors, and on iOS, captured images.
Description¶
Provides access to the current AR frame’s camera, anchors, light estimate, and feature points. On iOS, also provides access to raw camera image planes, person segmentation buffers, and estimated depth data.
Platform availability:
iOS: Full support including captured image data, segmentation, and depth.
visionOS/macOS: Camera, anchors, and world mapping status are available. Captured image, segmentation, and depth properties return empty values because the passthrough camera feed is composited by the OS and not accessible to applications.
Properties¶
Array |
|
|
Vector2 |
|
|
Vector2 |
|
|
|
||
|
||
Vector2 |
|
|
float |
|
|
int |
|
Methods¶
PackedFloat32Array |
display_transform(orientation: int, viewportSize: Vector2) |
RefCounted |
get_anchor(index: int) |
int |
|
PackedByteArray |
get_captured_image_plane_data(plane: int) |
Vector2 |
get_captured_image_plane_size(plane: int) |
int |
get_captured_image_plane_stride(plane: int) |
PackedByteArray |
|
PackedByteArray |
Enumerations¶
enum WorldMappingStatus: 🔗
WorldMappingStatus NOT_AVAILABLE = 0
No world mapping information is available yet.
WorldMappingStatus LIMITED = 1
World mapping has started but remains limited.
WorldMappingStatus EXTENDING = 2
ARKit is actively extending the mapped area.
WorldMappingStatus MAPPED = 3
The local environment is well mapped.
Property Descriptions¶
Array anchors = [] 🔗
Array get_anchors()
The anchors associated with this frame.
ARCamera get_camera()
The camera sample for this frame.
Vector2 captured_image_size = Vector2(0, 0) 🔗
Vector2 get_captured_image_size()
Size of the captured camera image in pixels. iOS only. Returns zero on visionOS/macOS.
Vector2 estimated_depth_data_size = Vector2(0, 0) 🔗
Vector2 get_estimated_depth_data_size()
Size of the estimated depth buffer. iOS 13+ only. Requires PERSON_SEGMENTATION_WITH_DEPTH frame semantics enabled. Returns zero on visionOS/macOS.
ARLightEstimate light_estimate = null 🔗
ARLightEstimate get_light_estimate()
Estimated lighting information for this frame, if available.
ARPointCloud raw_feature_points = null 🔗
ARPointCloud get_raw_feature_points()
The raw feature-point cloud tracked in this frame, if available.
Vector2 segmentation_buffer_size = Vector2(0, 0) 🔗
Vector2 get_segmentation_buffer_size()
Size of the person segmentation buffer. iOS 13+ only. Requires PERSON_SEGMENTATION or PERSON_SEGMENTATION_WITH_DEPTH frame semantics enabled. Returns zero on visionOS/macOS.
float timestamp = 0.0 🔗
float get_timestamp()
The frame timestamp in seconds.
int world_mapping_status = 0 🔗
int get_world_mapping_status()
How complete the world map is for this frame. See WorldMappingStatus.
Method Descriptions¶
PackedFloat32Array display_transform(orientation: int, viewportSize: Vector2) 🔗
Returns a transform that maps normalized image coordinates into display coordinates for the given interface orientation and viewport size.
RefCounted get_anchor(index: int) 🔗
Returns the anchor at index from anchors, or null if the index is out of range.
int get_captured_image_plane_count() 🔗
Returns the number of planes in the captured camera image. iOS only. Returns 0 on visionOS/macOS.
PackedByteArray get_captured_image_plane_data(plane: int) 🔗
Returns the raw pixel data for the given image plane. iOS only. Returns empty on visionOS/macOS.
Vector2 get_captured_image_plane_size(plane: int) 🔗
Returns the dimensions of the given image plane. iOS only. Returns zero on visionOS/macOS.
int get_captured_image_plane_stride(plane: int) 🔗
Returns the bytes-per-row stride for the given image plane. iOS only. Returns 0 on visionOS/macOS.
PackedByteArray get_estimated_depth_data() 🔗
Returns the estimated depth buffer for person segmentation. iOS 13+ only. Requires PERSON_SEGMENTATION_WITH_DEPTH frame semantics. Returns empty on visionOS/macOS.
PackedByteArray get_segmentation_buffer() 🔗
Returns the person segmentation matte buffer. iOS 13+ only. Requires PERSON_SEGMENTATION frame semantics. Returns empty on visionOS/macOS.