:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/master/../../GodotApplePlugins/doc_classes/ARFrame.xml. .. _class_ARFrame: ARFrame ======= **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Contains per-frame AR data including camera pose, anchors, and on iOS, captured images. .. rst-class:: classref-introduction-group 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. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`Array` | :ref:`anchors` | ``[]`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`ARCamera` | :ref:`camera` | | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`Vector2` | :ref:`captured_image_size` | ``Vector2(0, 0)`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`Vector2` | :ref:`estimated_depth_data_size` | ``Vector2(0, 0)`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`ARLightEstimate` | :ref:`light_estimate` | ``null`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`ARPointCloud` | :ref:`raw_feature_points` | ``null`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`Vector2` | :ref:`segmentation_buffer_size` | ``Vector2(0, 0)`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`float` | :ref:`timestamp` | ``0.0`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ | :ref:`int` | :ref:`world_mapping_status` | ``0`` | +-----------------------------------------------+------------------------------------------------------------------------------------+-------------------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedFloat32Array` | :ref:`display_transform`\ (\ orientation\: :ref:`int`, viewportSize\: :ref:`Vector2`\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`RefCounted` | :ref:`get_anchor`\ (\ index\: :ref:`int`\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_captured_image_plane_count`\ (\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedByteArray` | :ref:`get_captured_image_plane_data`\ (\ plane\: :ref:`int`\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Vector2` | :ref:`get_captured_image_plane_size`\ (\ plane\: :ref:`int`\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`int` | :ref:`get_captured_image_plane_stride`\ (\ plane\: :ref:`int`\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedByteArray` | :ref:`get_estimated_depth_data`\ (\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`PackedByteArray` | :ref:`get_segmentation_buffer`\ (\ ) | +-----------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_ARFrame_WorldMappingStatus: .. rst-class:: classref-enumeration enum **WorldMappingStatus**: :ref:`🔗` .. _class_ARFrame_constant_NOT_AVAILABLE: .. rst-class:: classref-enumeration-constant :ref:`WorldMappingStatus` **NOT_AVAILABLE** = ``0`` No world mapping information is available yet. .. _class_ARFrame_constant_LIMITED: .. rst-class:: classref-enumeration-constant :ref:`WorldMappingStatus` **LIMITED** = ``1`` World mapping has started but remains limited. .. _class_ARFrame_constant_EXTENDING: .. rst-class:: classref-enumeration-constant :ref:`WorldMappingStatus` **EXTENDING** = ``2`` ARKit is actively extending the mapped area. .. _class_ARFrame_constant_MAPPED: .. rst-class:: classref-enumeration-constant :ref:`WorldMappingStatus` **MAPPED** = ``3`` The local environment is well mapped. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_ARFrame_property_anchors: .. rst-class:: classref-property :ref:`Array` **anchors** = ``[]`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`Array` **get_anchors**\ (\ ) The anchors associated with this frame. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_camera: .. rst-class:: classref-property :ref:`ARCamera` **camera** :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`ARCamera` **get_camera**\ (\ ) The camera sample for this frame. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_captured_image_size: .. rst-class:: classref-property :ref:`Vector2` **captured_image_size** = ``Vector2(0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`Vector2` **get_captured_image_size**\ (\ ) Size of the captured camera image in pixels. **iOS only.** Returns zero on visionOS/macOS. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_estimated_depth_data_size: .. rst-class:: classref-property :ref:`Vector2` **estimated_depth_data_size** = ``Vector2(0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`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. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_light_estimate: .. rst-class:: classref-property :ref:`ARLightEstimate` **light_estimate** = ``null`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`ARLightEstimate` **get_light_estimate**\ (\ ) Estimated lighting information for this frame, if available. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_raw_feature_points: .. rst-class:: classref-property :ref:`ARPointCloud` **raw_feature_points** = ``null`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`ARPointCloud` **get_raw_feature_points**\ (\ ) The raw feature-point cloud tracked in this frame, if available. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_segmentation_buffer_size: .. rst-class:: classref-property :ref:`Vector2` **segmentation_buffer_size** = ``Vector2(0, 0)`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`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. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_timestamp: .. rst-class:: classref-property :ref:`float` **timestamp** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`float` **get_timestamp**\ (\ ) The frame timestamp in seconds. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_property_world_mapping_status: .. rst-class:: classref-property :ref:`int` **world_mapping_status** = ``0`` :ref:`🔗` .. rst-class:: classref-property-setget - :ref:`int` **get_world_mapping_status**\ (\ ) How complete the world map is for this frame. See :ref:`WorldMappingStatus`. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_ARFrame_method_display_transform: .. rst-class:: classref-method :ref:`PackedFloat32Array` **display_transform**\ (\ orientation\: :ref:`int`, viewportSize\: :ref:`Vector2`\ ) :ref:`🔗` Returns a transform that maps normalized image coordinates into display coordinates for the given interface orientation and viewport size. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_method_get_anchor: .. rst-class:: classref-method :ref:`RefCounted` **get_anchor**\ (\ index\: :ref:`int`\ ) :ref:`🔗` Returns the anchor at ``index`` from :ref:`anchors`, or ``null`` if the index is out of range. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_method_get_captured_image_plane_count: .. rst-class:: classref-method :ref:`int` **get_captured_image_plane_count**\ (\ ) :ref:`🔗` Returns the number of planes in the captured camera image. **iOS only.** Returns 0 on visionOS/macOS. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_method_get_captured_image_plane_data: .. rst-class:: classref-method :ref:`PackedByteArray` **get_captured_image_plane_data**\ (\ plane\: :ref:`int`\ ) :ref:`🔗` Returns the raw pixel data for the given image plane. **iOS only.** Returns empty on visionOS/macOS. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_method_get_captured_image_plane_size: .. rst-class:: classref-method :ref:`Vector2` **get_captured_image_plane_size**\ (\ plane\: :ref:`int`\ ) :ref:`🔗` Returns the dimensions of the given image plane. **iOS only.** Returns zero on visionOS/macOS. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_method_get_captured_image_plane_stride: .. rst-class:: classref-method :ref:`int` **get_captured_image_plane_stride**\ (\ plane\: :ref:`int`\ ) :ref:`🔗` Returns the bytes-per-row stride for the given image plane. **iOS only.** Returns 0 on visionOS/macOS. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_method_get_estimated_depth_data: .. rst-class:: classref-method :ref:`PackedByteArray` **get_estimated_depth_data**\ (\ ) :ref:`🔗` Returns the estimated depth buffer for person segmentation. **iOS 13+ only.** Requires ``PERSON_SEGMENTATION_WITH_DEPTH`` frame semantics. Returns empty on visionOS/macOS. .. rst-class:: classref-item-separator ---- .. _class_ARFrame_method_get_segmentation_buffer: .. rst-class:: classref-method :ref:`PackedByteArray` **get_segmentation_buffer**\ (\ ) :ref:`🔗` Returns the person segmentation matte buffer. **iOS 13+ only.** Requires ``PERSON_SEGMENTATION`` frame semantics. Returns empty on visionOS/macOS. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)` .. |void| replace:: :abbr:`void (No return value.)`