Struct XRCpuImage.ConversionParams
Describes a set of conversion parameters for use with XRCpuImage's conversion methods.
Namespace: UnityEngine.XR.ARSubsystems
Syntax
public struct ConversionParams : IEquatable<XRCpuImage.ConversionParams>
Constructors
ConversionParams(XRCpuImage, TextureFormat, XRCpuImage.Transformation)
Constructs a XRCpuImage.ConversionParams using the image
's full
resolution. That is, it sets inputRect to (0, 0, image.width, image.height)
and
outputDimensions to (image.width, image.height)
.
Declaration
public ConversionParams(XRCpuImage image, TextureFormat format, XRCpuImage.Transformation transformation = XRCpuImage.Transformation.None)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage | image | The source XRCpuImage. |
TextureFormat | format | The |
XRCpuImage.Transformation | transformation | An optional XRCpuImage.Transformation to apply. |
Properties
inputRect
The portion of the original image that will be used as input to the conversion.
Declaration
public RectInt inputRect { get; set; }
Property Value
Type | Description |
---|---|
RectInt | The portion of the original image that will be converted. |
Remarks
The input rectangle must be completely contained inside the XRCpuImage
dimensions.
outputDimensions
The dimensions of the converted image. The output dimensions must be less than or equal to the inputRect's dimensions. If the output dimensions are less than the inputRect's dimensions, downsampling is performed using nearest neighbor.
Declaration
public Vector2Int outputDimensions { get; set; }
Property Value
Type | Description |
---|---|
Vector2Int | The dimensions of the converted image. |
outputFormat
The TextureFormat
to which to convert. See FormatSupported(TextureFormat) for a list of
supported formats.
Declaration
public TextureFormat outputFormat { get; set; }
Property Value
Type | Description |
---|---|
TextureFormat | The |
transformation
The transformation to apply to the image during conversion.
Declaration
public XRCpuImage.Transformation transformation { get; set; }
Property Value
Type | Description |
---|---|
XRCpuImage.Transformation | The transformation to apply to the image during conversion. |
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(XRCpuImage.ConversionParams)
Tests for equality.
Declaration
public bool Equals(XRCpuImage.ConversionParams other)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.ConversionParams | other | The other XRCpuImage.ConversionParams 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()
Generates a string representation of this XRCpuImage.ConversionParams.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representation of this XRCpuImage.ConversionParams. |
Overrides
Operators
Equality(XRCpuImage.ConversionParams, XRCpuImage.ConversionParams)
Tests for equality. Same as Equals(XRCpuImage.ConversionParams).
Declaration
public static bool operator ==(XRCpuImage.ConversionParams lhs, XRCpuImage.ConversionParams rhs)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.ConversionParams | lhs | The XRCpuImage.ConversionParams to compare with |
XRCpuImage.ConversionParams | rhs | The XRCpuImage.ConversionParams to compare with |
Returns
Type | Description |
---|---|
Boolean |
|
Inequality(XRCpuImage.ConversionParams, XRCpuImage.ConversionParams)
Tests for inequality. Same as !
Equals(XRCpuImage.ConversionParams).
Declaration
public static bool operator !=(XRCpuImage.ConversionParams lhs, XRCpuImage.ConversionParams rhs)
Parameters
Type | Name | Description |
---|---|---|
XRCpuImage.ConversionParams | lhs | The XRCpuImage.ConversionParams to compare with |
XRCpuImage.ConversionParams | rhs | The XRCpuImage.ConversionParams to compare with |
Returns
Type | Description |
---|---|
Boolean |
|