docs.unity3d.com
    Show / Hide Table of Contents

    Struct XRCameraConfiguration

    Contains information regarding the camera configuration.

    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public struct XRCameraConfiguration : IEquatable<XRCameraConfiguration>
    Remarks

    Different devices support different camera configurations. This includes the resolution of the image and may include framerate on some platforms.

    The camera image configuration affects the resolution of the image returned by TryAcquireLatestCpuImage(out XRCpuImage).

    Constructors

    XRCameraConfiguration(IntPtr, Vector2Int)

    Constructs a camera configuration without a framerate.

    Declaration
    public XRCameraConfiguration(IntPtr handle, Vector2Int resolution)
    Parameters
    Type Name Description
    IntPtr handle

    The platform specific native handle that can be used to get the native configuration.

    Vector2Int resolution

    The resolution of the camera image.

    XRCameraConfiguration(IntPtr, Vector2Int, Int32)

    Constructs a camera configuration with a framerate.

    Declaration
    public XRCameraConfiguration(IntPtr handle, Vector2Int resolution, int framerate)
    Parameters
    Type Name Description
    IntPtr handle

    The platform specific native handle that can be used to get the native configuration.

    Vector2Int resolution

    The resolution of the camera image.

    Int32 framerate

    The camera framerate. Throws ArgumentOutOfRangeException if framerate is less than or equal to zero.

    Properties

    framerate

    The framerate, if this camera configuration specifies one.

    Declaration
    public readonly int? framerate { get; }
    Property Value
    Type Description
    Nullable<Int32>

    The framerate, if this camera configuration specifies one. Otherwise, null.

    Remarks

    On some platforms, different resolutions may affect the available framerate.

    height

    The height of the camera resolution

    Declaration
    public readonly int height { get; }
    Property Value
    Type Description
    Int32

    The height, in pixels, of the camera resolution

    nativeConfigurationHandle

    The platform-dependent handle that contains information required to acquire the native camera configuration.

    Declaration
    public readonly IntPtr nativeConfigurationHandle { get; }
    Property Value
    Type Description
    IntPtr

    resolution

    The camera resolution.

    Declaration
    public readonly Vector2Int resolution { get; }
    Property Value
    Type Description
    Vector2Int

    The camera resolution in pixels.

    width

    The width of the camera resolution

    Declaration
    public readonly int width { get; }
    Property Value
    Type Description
    Int32

    The width, in pixels, of the camera resolution

    Methods

    Equals(Object)

    Tests for equality.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj

    The object to compare against.

    Returns
    Type Description
    Boolean

    True if obj is of type XRCameraConfiguration and Equals(XRCameraConfiguration) also returns true; otherwise false.

    Overrides
    ValueType.Equals(Object)

    Equals(XRCameraConfiguration)

    Tests for equality.

    Declaration
    public bool Equals(XRCameraConfiguration other)
    Parameters
    Type Name Description
    XRCameraConfiguration other

    The other XRCameraConfiguration to compare against.

    Returns
    Type Description
    Boolean

    True if every field in other is equal to this XRCameraConfiguration, otherwise false.

    GetHashCode()

    Generates a hash suitable for use with containers like HashSet and Dictionary.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    A hash code generated from this object's fields.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Converts the configuration to a string, suitable for debug logging.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()

    Operators

    Equality(XRCameraConfiguration, XRCameraConfiguration)

    Tests for equality. Same as Equals(XRCameraConfiguration).

    Declaration
    public static bool operator ==(XRCameraConfiguration lhs, XRCameraConfiguration rhs)
    Parameters
    Type Name Description
    XRCameraConfiguration lhs

    The left-hand side of the comparison.

    XRCameraConfiguration rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    True if lhs is equal to rhs, otherwise false.

    Inequality(XRCameraConfiguration, XRCameraConfiguration)

    Tests for inequality. Same as !Equals(XRCameraConfiguration).

    Declaration
    public static bool operator !=(XRCameraConfiguration lhs, XRCameraConfiguration rhs)
    Parameters
    Type Name Description
    XRCameraConfiguration lhs

    The left-hand side of the comparison.

    XRCameraConfiguration rhs

    The right-hand side of the comparison.

    Returns
    Type Description
    Boolean

    True if lhs is not equal to rhs, otherwise false.

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023