Struct XRCpuImage
Represents a single, raw image from a device camera. Provides access to the raw image plane data, as well as conversion methods to convert to color and grayscale formats. See Convert(ConversionParams, IntPtr, int) and ConvertAsync(ConversionParams). Use TryAcquireLatestCpuImage(out XRCpuImage) to get a XRCpuImage.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: solution.dll
Syntax
public struct XRCpuImage : IDisposable, IEquatable<XRCpuImage>
Remarks
Each XRCpuImage must be explicitly disposed. Failing to do so will leak resources and could prevent future camera image access.
Properties
Name | Description |
---|---|
dimensions | The dimensions (width and height) of the image. |
format | The format used by the image planes. You will only need this if you plan to interpret the raw plane data. |
height | The image height. |
planeCount | The number of image planes. A plane in this context refers to a channel in the raw video format, not a physical surface. |
timestamp | The timestamp, in seconds, associated with this camera image |
valid | Whether this |
width | The image width. |
Methods
Name | Description |
---|---|
Convert(ConversionParams, IntPtr, int) | Convert the |
Convert(ConversionParams, NativeSlice<byte>) | Convert the |
ConvertAsync(ConversionParams) | Convert the |
ConvertAsync(ConversionParams, Action<AsyncConversionStatus, ConversionParams, NativeArray<byte>>) | Convert the The |
Dispose() | Dispose native resources associated with this request, including the raw image data. Any
XRCpuImage.Planes returned by GetPlane(int) are invalidated immediately after
calling |
Equals(object) | Tests for equality. |
Equals(XRCpuImage) | Tests for equality. |
FormatSupported(TextureFormat) | Determines whether the given TextureFormat is supported for conversion. |
GetConvertedDataSize(Vector2Int, TextureFormat) | Get the number of bytes required to store a converted image with the given parameters. |
GetConvertedDataSize(ConversionParams) | Get the number of bytes required to store a converted image with the given parameters. |
GetHashCode() | Generates a hash suitable for use with containers like |
GetPlane(int) | Get an image plane. A plane in this context refers to a channel in the raw video format, not a physical surface. |
ToString() | Generates a string representation of this XRCpuImage. |
Operators
Name | Description |
---|---|
operator ==(XRCpuImage, XRCpuImage) | Tests for equality. Same as Equals(XRCpuImage). |
operator !=(XRCpuImage, XRCpuImage) | Tests for inequality. Same as |