Struct XRCameraConfiguration
Contains information regarding the camera configuration.
Namespace: UnityEngine.XR.ARSubsystems
Syntax
public struct XRCameraConfiguration : IEquatable<XRCameraConfiguration>
Remarks
Different devices support different camera configurations. This includes the resolution of the image and may 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. |
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 can be used to get the native configuration. |
Vector2Int | resolution | The resolution of the camera image. |
Int32 | framerate | The camera framerate. Throws |
Properties
framerate
The framerate, if this camera configuration specifies one.
Declaration
public int? framerate { get; }
Property Value
Type | Description |
---|---|
Nullable<Int32> | The framerate, if this camera configuration specifies one. Otherwise, |
Remarks
On some platforms, different resolutions may affect the available framerate.
height
The height of the camera resolution
Declaration
public 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 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 |
---|---|
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 |
|
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 |
|