docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRCpuImageFormatExtensions

    Extensions to convert between TextureFormat and XRCpuImage.Format.

    Inheritance
    object
    XRCpuImageFormatExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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 this if possible. Returns 0 if there is no matching texture format.

    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 this if possible. Returns Unknown if there is no matching XRCpuImage.Format.

    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.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)