Struct XRCameraConfiguration
Contains information about camera configuration.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
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. |
UnityEngine.Vector2Int | resolution | The resolution of the camera image. |
Remarks
framerate will have no value, and depthSensorSupported is set to Unknown.
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 you can use to get the native configuration. |
UnityEngine.Vector2Int | resolution | The resolution of the camera image. |
Int32 | framerate | The camera framerate. Throws |
Remarks
depthSensorSupported is set to Unknown.
XRCameraConfiguration(IntPtr, Vector2Int, Nullable<Int32>, 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. |
UnityEngine.Vector2Int | resolution | The resolution of the camera image. |
Nullable<Int32> | framerate | The camera framerate. |
Supported | depthSensorSupported | Whether the configuration supports a depth sensor. |
Exceptions
Type | Condition |
---|---|
ArgumentOutOfRangeException | Thrown if |
Properties
depthSensorSupported
Whether the configuration supports a depth sensor.
Declaration
public readonly 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 readonly int? framerate { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The framerate, if this camera configuration specifies one. Otherwise, |
Remarks
On some platforms, different resolutions might 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 |
---|---|
UnityEngine.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 |
Returns
Type | Description |
---|---|
Boolean |
|
Overrides
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 |
|
Implements
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
ToString()
Converts the configuration to a string, suitable for debug logging.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
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 |
|
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 |
|