Struct XRCameraImageConversionParams | AR Subsystems | 3.1.10
docs.unity3d.com
    Show / Hide Table of Contents

    Struct XRCameraImageConversionParams

    Describes a set of conversion parameters for use with XRCameraImage's conversion methods.

    Namespace: UnityEngine.XR.ARSubsystems
    Syntax
    public struct XRCameraImageConversionParams : IEquatable<XRCameraImageConversionParams>

    Constructors

    XRCameraImageConversionParams(XRCameraImage, TextureFormat, CameraImageTransformation)

    Constructs a XRCameraImageConversionParams 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 XRCameraImageConversionParams(XRCameraImage image, TextureFormat format, CameraImageTransformation transformation = CameraImageTransformation.None)
    Parameters
    Type Name Description
    XRCameraImage image

    The source XRCameraImage.

    TextureFormat format

    The TextureFormat to convert to.

    CameraImageTransformation transformation

    An optional CameraImageTransformation 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 XRCameraImage 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 TextureFormat to which to convert.

    transformation

    The transformation to apply to the image during conversion.

    Declaration
    public CameraImageTransformation transformation { get; set; }
    Property Value
    Type Description
    CameraImageTransformation

    The transformation to apply to the image during conversion.

    Methods

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    Equals(XRCameraImageConversionParams)

    Declaration
    public bool Equals(XRCameraImageConversionParams other)
    Parameters
    Type Name Description
    XRCameraImageConversionParams other
    Returns
    Type Description
    Boolean

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    String
    Overrides
    ValueType.ToString()

    Operators

    Equality(XRCameraImageConversionParams, XRCameraImageConversionParams)

    Declaration
    public static bool operator ==(XRCameraImageConversionParams lhs, XRCameraImageConversionParams rhs)
    Parameters
    Type Name Description
    XRCameraImageConversionParams lhs
    XRCameraImageConversionParams rhs
    Returns
    Type Description
    Boolean

    Inequality(XRCameraImageConversionParams, XRCameraImageConversionParams)

    Declaration
    public static bool operator !=(XRCameraImageConversionParams lhs, XRCameraImageConversionParams rhs)
    Parameters
    Type Name Description
    XRCameraImageConversionParams lhs
    XRCameraImageConversionParams rhs
    Returns
    Type Description
    Boolean
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023