Struct XRCameraConfiguration
Contains information about camera configuration.
Implements
Inherited Members
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 |
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 |
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, |
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 |
Returns
Type | Description |
---|---|
bool |
|
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 |
---|---|
bool |
|
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
ToString()
Converts the configuration to a string, suitable for debug logging.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string |
Overrides
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 |
|
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 |
|