docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct XRCameraConfiguration

    Contains information about camera configuration.

    Implements
    IEquatable<XRCameraConfiguration>
    Inherited Members
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public struct XRCameraConfiguration : IEquatable<XRCameraConfiguration>
    Remarks

    Different devices support different camera configurations. This includes image resolution and might 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.

    Remarks

    framerate will have no value, and depthSensorSupported is set to Unknown.

    XRCameraConfiguration(IntPtr, Vector2Int, int)

    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 you can use to get the native configuration.

    Vector2Int resolution

    The resolution of the camera image.

    int framerate

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

    Remarks

    depthSensorSupported is set to Unknown.

    XRCameraConfiguration(IntPtr, Vector2Int, int?, Supported)

    Constructs a camera configuration.

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

    The platform-specific native handle that you can use to get the native configuration.

    Vector2Int resolution

    The resolution of the camera image.

    int? framerate

    The camera framerate.

    Supported depthSensorSupported

    Whether the configuration supports a depth sensor.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    Thrown if framerate has a value less than or equal to zero.

    Properties

    depthSensorSupported

    Whether the configuration supports a depth sensor.

    Declaration
    public Supported depthSensorSupported { get; }
    Property Value
    Type Description
    Supported

    A value indicating whether a depth sensor is supported, not supported, or if support is unknown.

    framerate

    The framerate, if this camera configuration specifies one.

    Declaration
    public int? framerate { get; }
    Property Value
    Type Description
    int?

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

    Remarks

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

    height

    The height of the camera resolution.

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

    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 IntPtr nativeConfigurationHandle { get; }
    Property Value
    Type Description
    IntPtr

    resolution

    The camera resolution.

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

    The camera resolution in pixels.

    width

    The width of the camera resolution.

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

    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
    bool

    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
    bool

    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
    int

    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

    operator ==(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
    bool

    True if lhs is equal to rhs, otherwise false.

    operator !=(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
    bool

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

    Implements

    IEquatable<T>
    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)