Class XRCpuImageFormatExtensions
Extensions to convert between TextureFormat and XRCpuImage.Format.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public static class XRCpuImageFormatExtensions
Methods
AsTextureFormat(Format)
Attempts to convert an XRCpuImage.Format to a TextureFormat.
Declaration
public static TextureFormat AsTextureFormat(this XRCpuImage.Format @this)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.Format | this | Defines an extension of XRCpuImage.Format. |
Returns
Type | Description |
---|---|
TextureFormat | Returns a texture format that matches |
ToXRCpuImageFormat(TextureFormat)
Attempts to convert a TextureFormat to an XRCpuImage.Format.
Declaration
public static XRCpuImage.Format ToXRCpuImageFormat(this TextureFormat @this)
Parameters
Type | Name | Description |
---|---|---|
TextureFormat | this | Defines an extension of TextureFormat. |
Returns
Type | Description |
---|---|
XRCpuImage.Format | Returns a XRCpuImage.Format that matches |
Remarks
For some formats, there may be multiple XRCpuImage.Formats that match the format. In this case this method will return a generalized format. For example, RFloat will return OneComponent32 instead of DepthFloat32 as it's possible that the single channel is not depth. In these cases, you should also check the image type.