docs.unity3d.com
    Show / Hide Table of Contents

    Struct ArCameraConfigFilter

    Used to filter the set of camera configurations returned by XRCameraSubsystem.GetConfigurations.

    Inherited Members
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: UnityEngine.XR.ARCore
    Syntax
    public struct ArCameraConfigFilter : IDisposable, IEquatable<ArCameraConfigFilter>

    Constructors

    ArCameraConfigFilter(ArSession)

    Creates a new, default-constructed ArCameraConfigFilter.

    Declaration
    public ArCameraConfigFilter(ArSession session)
    Parameters
    Type Name Description
    ArSession session

    A non-null ArSession.

    Remarks

    When you no longer need the ArCameraConfigFilter, you should destroy it by calling Dispose(). If you do not dispose it, ARCore will leak memory.

    Properties

    IsNull

    (Read Only) Indicates whether this ArCameraConfigFilter is null. This property is deprecated. Use the equality operator (==) to compare with null instead.

    Declaration
    [Obsolete("Compare to null instead.")]
    public readonly bool IsNull { get; }
    Property Value
    Type Description
    Boolean

    Null

    (Read Only) Represents a null ArCameraConfigFilter, i.e., one whose underlying native pointer is null. This property is deprecated. Use default instead.

    Declaration
    [Obsolete("Use default instead.")]
    public static readonly ArCameraConfigFilter Null { get; }
    Property Value
    Type Description
    ArCameraConfigFilter

    Methods

    AsIntPtr()

    Gets the underlying native pointer for this ArCameraConfigFilter.

    Declaration
    public IntPtr AsIntPtr()
    Returns
    Type Description
    IntPtr

    Returns the underlying native pointer for this ArCameraConfigFilter.

    Dispose()

    Destroys this ArCameraConfigFilter and sets the underlying native pointer to null.

    Declaration
    public void Dispose()
    Implements
    IDisposable.Dispose()
    Remarks

    You should only dispose an ArCameraConfigFilter if you explicitly created it, e.g., by calling ArCameraConfigFilter(ArSession). If you convert an existing config from an IntPtr (e.g., by calling FromIntPtr(IntPtr)), then you should not dispose it.

    Equals(Object)

    Tests for equality.

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

    An Object to compare against.

    Returns
    Type Description
    Boolean

    Returns true if obj is an ArCameraConfigFilter and it compares equal to this one using Equals(ArCameraConfigFilter).

    Overrides
    ValueType.Equals(Object)

    Equals(ArCameraConfigFilter)

    Tests for equality.

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

    The ArCameraConfigFilter to compare against.

    Returns
    Type Description
    Boolean

    Returns true if the underlying native pointers are the same. Returns false otherwise.

    Implements
    IEquatable<T>.Equals(T)
    Remarks

    Two ArCameraConfigFilters are considered equal if their underlying pointers are equal.

    FromIntPtr(IntPtr)

    Creates an ArCameraConfigFilter from an existing native pointer. The native pointer must point to an existing ArCameraConfigFilter.

    Declaration
    public static ArCameraConfigFilter FromIntPtr(IntPtr value)
    Parameters
    Type Name Description
    IntPtr value

    A pointer to an existing native ArCameraConfigFilter.

    Returns
    Type Description
    ArCameraConfigFilter

    Returns an ArCameraConfigFilter whose underlying native pointer is value.

    GetDepthSensorUsage(ArSession)

    Gets the desired depth sensor usages to allow.

    Declaration
    public ArCameraConfigDepthSensorUsage GetDepthSensorUsage(ArSession session)
    Parameters
    Type Name Description
    ArSession session

    The ARCore ArSession.

    Returns
    Type Description
    ArCameraConfigDepthSensorUsage

    Returns the ArCameraConfigDepthSensorUsage values allowed by this filter.

    GetHashCode()

    Generates a hash code suitable for use with a HashSet or Dictionary

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32

    Returns a hash code for this ArCameraConfigFilter.

    Overrides
    ValueType.GetHashCode()

    GetTargetFps(ArSession)

    Gets the desired frame rates to allow.

    Declaration
    public ArCameraConfigTargetFps GetTargetFps(ArSession session)
    Parameters
    Type Name Description
    ArSession session

    The ARCore ArSession.

    Returns
    Type Description
    ArCameraConfigTargetFps

    Returns the frame rates allowed by this filter.

    SetDepthSensorUsage(ArSession, ArCameraConfigDepthSensorUsage)

    Sets the desired depth sensor usages to allow.

    Declaration
    public void SetDepthSensorUsage(ArSession session, ArCameraConfigDepthSensorUsage depthSensorUsage)
    Parameters
    Type Name Description
    ArSession session

    The ARCore ArSession.

    ArCameraConfigDepthSensorUsage depthSensorUsage

    The ArCameraConfigDepthSensorUsage values allowed by this filter.

    SetTargetFps(ArSession, ArCameraConfigTargetFps)

    Sets the desired frame rates to allow.

    Declaration
    public void SetTargetFps(ArSession session, ArCameraConfigTargetFps targetFps)
    Parameters
    Type Name Description
    ArSession session

    The ARCore ArSession.

    ArCameraConfigTargetFps targetFps

    The ArCameraConfigTargetFps values allowed by this filter.

    Operators

    Equality(Nullable<ArCameraConfigFilter>, Nullable<ArCameraConfigFilter>)

    Tests for equality.

    Declaration
    public static bool operator ==(ArCameraConfigFilter? lhs, ArCameraConfigFilter? rhs)
    Parameters
    Type Name Description
    Nullable<ArCameraConfigFilter> lhs

    The nullable ArCameraConfigFilter to compare with rhs.

    Nullable<ArCameraConfigFilter> rhs

    The nullable ArCameraConfigFilter to compare with lhs.

    Returns
    Type Description
    Boolean

    Returns true if any of these conditions are met:

    • lhs and rhs are both not null and their underlying pointers are equal.
    • lhs is null and rhs's underlying pointer is null.
    • rhs is null and lhs's underlying pointer is null.
    • Both lhs and rhs are null.

    Returns false otherwise.

    Remarks

    This equality operator lets you to compare an ArCameraConfigFilter with null to determine whether its underlying pointer is null. This allows for a more natural comparison with the native ARCore object:

    bool TestForNull(ArCameraConfigFilter obj)
    {
        if (obj == null)
        {
            // obj.AsIntPtr() is IntPtr.Zero
        }
    }

    Equality(ArCameraConfigFilter, ArCameraConfigFilter)

    Tests for equality. Same as Equals(ArCameraConfigFilter).

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

    The ArCameraConfigFilter to compare with rhs.

    ArCameraConfigFilter rhs

    The ArCameraConfigFilter to compare with lhs.

    Returns
    Type Description
    Boolean

    Returns true if lhs is equal to rhs using Equals(ArCameraConfigFilter). Returns false otherwise.

    Explicit(ArCameraConfigFilter to IntPtr)

    Casts an ArCameraConfigFilter to its underlying native pointer.

    Declaration
    public static explicit operator IntPtr(ArCameraConfigFilter filter)
    Parameters
    Type Name Description
    ArCameraConfigFilter filter

    The ArCameraConfigFilter to cast.

    Returns
    Type Description
    IntPtr

    Returns the underlying native pointer for filter

    Inequality(Nullable<ArCameraConfigFilter>, Nullable<ArCameraConfigFilter>)

    Tests for inequality.

    Declaration
    public static bool operator !=(ArCameraConfigFilter? lhs, ArCameraConfigFilter? rhs)
    Parameters
    Type Name Description
    Nullable<ArCameraConfigFilter> lhs

    The native object to compare with rhs.

    Nullable<ArCameraConfigFilter> rhs

    The native object to compare with lhs.

    Returns
    Type Description
    Boolean

    Returns false if any of these conditions are met:

    • lhs and rhs are both not null and their underlying pointers are equal.
    • lhs is null and rhs's underlying pointer is null.
    • rhs is null and lhs's underlying pointer is null.
    • Both lhs and rhs are null.

    Returns true otherwise.

    Remarks

    This inequality operator lets you to compare an ArCameraConfigFilter with null to determine whether its underlying pointer is null. This allows for a more natural comparison with the native ARCore object:

    bool TestForNull(ArCameraConfigFilter obj)
    {
        if (obj != null)
        {
            // obj.AsIntPtr() is not IntPtr.Zero
        }
    }

    Inequality(ArCameraConfigFilter, ArCameraConfigFilter)

    Tests for inequality. Same as the negation of Equals(ArCameraConfigFilter).

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

    The ArCameraConfigFilter to compare with rhs.

    ArCameraConfigFilter rhs

    The ArCameraConfigFilter to compare with lhs.

    Returns
    Type Description
    Boolean

    Returns false if lhs is equal to rhs using Equals(ArCameraConfigFilter). Returns true otherwise.

    See Also

    beforeGetCameraConfiguration
    ARCoreBeforeGetCameraConfigurationEventArgs
    Back to top
    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