Struct ArCameraConfig
Represents an ARCore camera configuration.
Namespace: UnityEngine.XR.ARCore
Syntax
public struct ArCameraConfig : IDisposable, IEquatable<ArCameraConfig>
Constructors
ArCameraConfig(ArSession)
Creates a new camera config object. To prevent memory leaks, this object should be disposed with Dispose() when you no longer need it.
Declaration
public ArCameraConfig(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Properties
IsNull
(Read Only) Indicates whether this ArCameraConfig is Null.
Declaration
public readonly bool IsNull { get; }
Property Value
Type | Description |
---|---|
Boolean |
Null
Represents a null ArCameraConfig, i.e., one whose underlying native pointer is null
.
Declaration
public static readonly ArCameraConfig Null { get; }
Property Value
Type | Description |
---|---|
ArCameraConfig |
Methods
AsIntPtr()
Gets the underlying native pointer for this ArCameraConfig.
Declaration
public IntPtr AsIntPtr()
Returns
Type | Description |
---|---|
IntPtr | Returns the underlying native pointer for this ArCameraConfig. |
Dispose()
Destroys this ArCameraConfig and sets its underlying pointer to null
.
Declaration
public void Dispose()
Remarks
You should only dispose an ArCameraConfig if you explicitly created it, e.g., by calling ArCameraConfig(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 |
Overrides
Equals(ArCameraConfig)
Tests for equality.
Declaration
public bool Equals(ArCameraConfig other)
Parameters
Type | Name | Description |
---|---|---|
ArCameraConfig | other | The ArCameraConfig to compare against. |
Returns
Type | Description |
---|---|
Boolean | Returns |
Remarks
Two ArCameraConfigs are considered equal if their underlying pointers are equal.
FromIntPtr(IntPtr)
Create a ArCameraConfig from an existing native pointer. The native pointer must point to an existing ArCameraConfig.
Declaration
public static ArCameraConfig FromIntPtr(IntPtr value)
Parameters
Type | Name | Description |
---|---|---|
IntPtr | value | A pointer to an existing native ArCameraConfig. |
Returns
Type | Description |
---|---|
ArCameraConfig | Returns an ArCameraConfig whose underlying native pointer is
|
GetCameraId(ArSession)
Obtains the camera id for this camera config.
Declaration
public string GetCameraId(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
String | Returns the camera id for this camera config. |
GetDepthSensorUsage(ArSession)
Gets the depth sensor usage settings.
Declaration
public ArCameraConfigDepthSensorUsage GetDepthSensorUsage(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
ArCameraConfigDepthSensorUsage | Returns the depth sensor usage settings. |
GetFacingDirection(ArSession)
Gets the facing direction of the camera selected by this config.
Declaration
public ArCameraConfigFacingDirection GetFacingDirection(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
ArCameraConfigFacingDirection | Returns the facing direction of the camera selected by this config. |
GetFpsRange(ArSession)
Gets the minimum and maximum camera capture rate in frames per second (fps) for the current camera config.
Declaration
public (int minFps, int maxFps) GetFpsRange(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
(T1, T2)<Int32, Int32> | Returns the minimum and maximum camera capture rate in frames per second supported by this camera config. |
Remarks
Actual capture frame rate will vary within this range, depending on lighting conditions. Frame rates will generally be lower under poor lighting conditions to accommodate longer exposure times.
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 ArCameraConfig. |
Overrides
GetImageDimensions(ArSession)
Gets the camera image dimensions for this camera config.
Declaration
public (int width, int height) GetImageDimensions(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
(T1, T2)<Int32, Int32> | Returns the camera image dimensions for this camera config. |
GetTextureDimensions(ArSession)
Gets the camera texture dimensions for this camera config.
Declaration
public (int width, int height) GetTextureDimensions(ArSession session)
Parameters
Type | Name | Description |
---|---|---|
ArSession | session | The ARCore session. |
Returns
Type | Description |
---|---|
(T1, T2)<Int32, Int32> | Returns the camera texture dimensions for this camera config. |
Operators
Equality(ArCameraConfig, ArCameraConfig)
Tests for equality. Same as Equals(ArCameraConfig).
Declaration
public static bool operator ==(ArCameraConfig lhs, ArCameraConfig rhs)
Parameters
Type | Name | Description |
---|---|---|
ArCameraConfig | lhs | The ArCameraConfig to compare with |
ArCameraConfig | rhs | The ArCameraConfig to compare with |
Returns
Type | Description |
---|---|
Boolean | Returns |
Explicit(ArCameraConfig to IntPtr)
Casts an ArCameraConfig to its underlying native pointer.
Declaration
public static explicit operator IntPtr(ArCameraConfig cameraConfig)
Parameters
Type | Name | Description |
---|---|---|
ArCameraConfig | cameraConfig | The ArCameraConfig to cast. |
Returns
Type | Description |
---|---|
IntPtr | Returns the underlying native pointer for |
Inequality(ArCameraConfig, ArCameraConfig)
Tests for inequality. Same as the negation of Equals(ArCameraConfig).
Declaration
public static bool operator !=(ArCameraConfig lhs, ArCameraConfig rhs)
Parameters
Type | Name | Description |
---|---|---|
ArCameraConfig | lhs | The ArCameraConfig to compare with |
ArCameraConfig | rhs | The ArCameraConfig to compare with |
Returns
Type | Description |
---|---|
Boolean | Returns |