Struct XRCpuImage.ConversionParams
Describes a set of conversion parameters for use with XRCpu
Implements
Inherited Members
Namespace: UnityEngine .XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public struct XRCpuImage.ConversionParams : IEquatable<XRCpuImage.ConversionParams>
Constructors
ConversionParams(XRCpuImage, TextureFormat, Transformation)
Constructs a XRCpuimage
's full
resolution. That is, it sets input(0, 0, image.width, image.height)
and
output(image.width, image.height)
.
Declaration
public ConversionParams(XRCpuImage image, TextureFormat format, XRCpuImage.Transformation transformation = Transformation.None)
Parameters
Type | Name | Description |
---|---|---|
XRCpu |
image | The source XRCpu |
Texture |
format | The |
XRCpu |
transformation | An optional XRCpu |
Properties
inputRect
The portion of the original image that will be used as input to the conversion.
The input rectangle must be completely contained inside the XRCpuImage
dimensions.
Declaration
public RectInt inputRect { get; set; }
Property Value
Type | Description |
---|---|
Rect |
The portion of the original image that will be converted. |
Remarks
It can be significantly faster to convert a sub-rectangle of the original image if you know which part of the image you need.
outputDimensions
The dimensions of the converted image. The output dimensions must be less than or equal to the
input
Declaration
public Vector2Int outputDimensions { get; set; }
Property Value
Type | Description |
---|---|
Vector2Int | The dimensions of the converted image. |
Examples
For example, you could supply (inputRect.width / 2, inputRect.height / 2)
to get a half resolution image.
This can decrease the time it takes to perform a color conversion.
outputFormat
The TextureFormat
to which to convert. See Format
Declaration
public TextureFormat outputFormat { get; set; }
Property Value
Type | Description |
---|---|
Texture |
The |
transformation
The transformation to apply to the image during conversion.
Declaration
public XRCpuImage.Transformation transformation { get; set; }
Property Value
Type | Description |
---|---|
XRCpu |
The transformation to apply to the image during conversion. |
Remarks
Transformations typically do not increase the processing time.
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(ConversionParams)
Tests for equality.
Declaration
public bool Equals(XRCpuImage.ConversionParams other)
Parameters
Type | Name | Description |
---|---|---|
XRCpu |
other | The other XRCpu |
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()
Generates a string representation of this XRCpu
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string representation of this XRCpu |
Overrides
Operators
operator ==(ConversionParams, ConversionParams)
Tests for equality. Same as Equals(Conversion
Declaration
public static bool operator ==(XRCpuImage.ConversionParams lhs, XRCpuImage.ConversionParams rhs)
Parameters
Type | Name | Description |
---|---|---|
XRCpu |
lhs | The XRCpu |
XRCpu |
rhs | The XRCpu |
Returns
Type | Description |
---|---|
bool |
|
operator !=(ConversionParams, ConversionParams)
Tests for inequality. Same as !
Equals(Conversion
Declaration
public static bool operator !=(XRCpuImage.ConversionParams lhs, XRCpuImage.ConversionParams rhs)
Parameters
Type | Name | Description |
---|---|---|
XRCpu |
lhs | The XRCpu |
XRCpu |
rhs | The XRCpu |
Returns
Type | Description |
---|---|
bool |
|