Method ToXRCpuImageFormat
ToXRCpuImageFormat(TextureFormat)
Attempts to convert a UnityEngine.TextureFormat to an XRCpuImage.Format.
Declaration
public static XRCpuImage.Format ToXRCpuImageFormat(this TextureFormat @this)
Parameters
| Type | Name | Description |
|---|---|---|
| TextureFormat | this | Defines an extension of UnityEngine.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, UnityEngine.TextureFormat.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.