Stay organized with collections
Save and categorize content based on your preferences.
XRCameraFrameExtensions
Extensions to AR Subsystem's XRCameraFrame struct.
Summary
Public static functions
GetImageDisplayMatrix
Matrix4x4 GetImageDisplayMatrix(
this XRCameraFrame frame
)
Get the 4x4 image display matrix for the camera frame.
This is used by the texture populated based on CPU images to calculate the display coordinates.
Details |
Parameters |
frame
|
The XRCameraFrame instance.
|
|
Returns
|
The 4x4 image display matrix.
|
TryGetFrameTimestamp
bool TryGetFrameTimestamp(
this XRCameraFrame frame,
out long frameTimestamp
)
Get the timestamp of the camera frame.
Details |
Parameters |
frame
|
The XRCameraFrame instance.
|
frameTimestamp
|
The timestamp of the camera frame.
|
|
Returns
|
True if the timestamp is available, false otherwise.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[null,null,["Last updated 2025-07-14 UTC."],[[["\u003cp\u003eXRCameraFrameExtensions provide additional functionality to the XRCameraFrame struct in AR Subsystem.\u003c/p\u003e\n"],["\u003cp\u003eA key function, GetImageDisplayMatrix, calculates the display coordinates by retrieving a 4x4 image display matrix from the camera frame data.\u003c/p\u003e\n"],["\u003cp\u003eThis matrix is crucial for correctly displaying textures based on CPU images within the AR experience.\u003c/p\u003e\n"]]],[],null,["# XRCameraFrameExtensions Class Reference\n\nXRCameraFrameExtensions\n=======================\n\nExtensions to AR Subsystem's XRCameraFrame struct.\n\nSummary\n-------\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------|\n| [GetImageDisplayMatrix](#getimagedisplaymatrix)`(this `[XRCameraFrame](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraFrame.html)` frame)` | [Matrix4x4](https://docs.unity3d.com/ScriptReference/Matrix4x4.html) Get the 4x4 image display matrix for the camera frame. |\n| [TryGetFrameTimestamp](#trygetframetimestamp)`(this `[XRCameraFrame](https://docs.unity3d.com/Packages/com.unity.xr.arsubsystems@4.2/api/UnityEngine.XR.ARSubsystems.XRCameraFrame.html)` frame, out long frameTimestamp)` | `bool` Get the timestamp of the camera frame. |\n\nPublic static functions\n-----------------------\n\n### GetImageDisplayMatrix\n\n```c#\nMatrix4x4 GetImageDisplayMatrix(\n this XRCameraFrame frame\n)\n``` \nGet the 4x4 image display matrix for the camera frame.\n\nThis is used by the texture populated based on CPU images to calculate the display coordinates.\n\n\n| Details ||\n|-------------|-------------------------------------------------------------------------------------|\n| Parameters | |---------|-----------------------------| | `frame` | The XRCameraFrame instance. | |\n| **Returns** | The 4x4 image display matrix. |\n\n### TryGetFrameTimestamp\n\n```c#\nbool TryGetFrameTimestamp(\n this XRCameraFrame frame,\n out long frameTimestamp\n)\n``` \nGet the timestamp of the camera frame.\n\n\n| Details ||\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |------------------|------------------------------------| | `frame` | The XRCameraFrame instance. | | `frameTimestamp` | The timestamp of the camera frame. | |\n| **Returns** | True if the timestamp is available, false otherwise. |"]]