Struct XRCameraFrame | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Struct XRCameraFrame

    Parameters of the Unity Camera that may be necessary/useful to the provider.

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

    Properties

    averageBrightness

    The estimated brightness of the scene.

    Declaration
    public float averageBrightness { get; }
    Property Value
    Type Description
    System.Single

    The estimated brightness of the scene.

    averageColorTemperature

    The estimated color temperature of the scene.

    Declaration
    public float averageColorTemperature { get; }
    Property Value
    Type Description
    System.Single

    The estimated color temperature of the scene.

    colorCorrection

    The estimated color correction value of the scene.

    Declaration
    public Color colorCorrection { get; }
    Property Value
    Type Description
    Color

    The estimated color correction value of the scene.

    displayMatrix

    The 4x4 display matrix for the camera frame.

    Declaration
    public Matrix4x4 displayMatrix { get; }
    Property Value
    Type Description
    Matrix4x4

    The 4x4 display matrix for the camera frame.

    hasAverageBrightness

    Whether the frame has an average brightness.

    Declaration
    public bool hasAverageBrightness { get; }
    Property Value
    Type Description
    System.Boolean

    Whether the frame has an average brightness.

    hasAverageColorTemperature

    Whether the frame has an average color temperature.

    Declaration
    public bool hasAverageColorTemperature { get; }
    Property Value
    Type Description
    System.Boolean

    Whether the frame has an average color temperature.

    hasColorCorrection

    Whether the frame has a color correction value.

    Declaration
    public bool hasColorCorrection { get; }
    Property Value
    Type Description
    System.Boolean

    Whether the frame has a color correction value.

    hasDisplayMatrix

    Whether the frame has a display matrix.

    Declaration
    public bool hasDisplayMatrix { get; }
    Property Value
    Type Description
    System.Boolean

    Whether the frame has a display matrix.

    hasProjectionMatrix

    Whether the frame has a projection matrix.

    Declaration
    public bool hasProjectionMatrix { get; }
    Property Value
    Type Description
    System.Boolean

    Whether the frame has a projection matrix.

    hasTimestamp

    Whether the frame has a timestamp.

    Declaration
    public bool hasTimestamp { get; }
    Property Value
    Type Description
    System.Boolean

    Whether the frame has a timestamp.

    nativePtr

    A native pointer associated with this frame. The data pointed to by this pointer is implementation defined.

    Declaration
    public IntPtr nativePtr { get; }
    Property Value
    Type Description
    System.IntPtr

    projectionMatrix

    The 4x4 projection matrix for the camera frame.

    Declaration
    public Matrix4x4 projectionMatrix { get; }
    Property Value
    Type Description
    Matrix4x4

    The 4x4 projection matrix for the camera frame.

    properties

    The set of all flags indicating which properties are included in the frame.

    Declaration
    public XRCameraFrameProperties properties { get; }
    Property Value
    Type Description
    XRCameraFrameProperties

    The set of all flags indicating which properties are included in the frame.

    timestampNs

    The timestamp, in nanoseconds, associated with this frame.

    Declaration
    public long timestampNs { get; }
    Property Value
    Type Description
    System.Int64

    The timestamp, in nanoseconds, associated with this frame.

    trackingState

    The TrackingState associated with the camera.

    Declaration
    public TrackingState trackingState { get; }
    Property Value
    Type Description
    TrackingState

    Methods

    Equals(Object)

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

    Equals(XRCameraFrame)

    Declaration
    public bool Equals(XRCameraFrame other)
    Parameters
    Type Name Description
    XRCameraFrame other
    Returns
    Type Description
    System.Boolean

    GetHashCode()

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

    ToString()

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

    TryGetAverageBrightness(out Single)

    Provides brightness for the whole image as an average of all pixels' brightness.

    Declaration
    public bool TryGetAverageBrightness(out float averageBrightness)
    Parameters
    Type Name Description
    System.Single averageBrightness

    An estimated average brightness for the environment.

    Returns
    Type Description
    System.Boolean

    true if average brightness was provided. Otherwise, false.

    TryGetAverageColorTemperature(out Single)

    Provides color temperature for the whole image as an average of all pixels' color temperature.

    Declaration
    public bool TryGetAverageColorTemperature(out float averageColorTemperature)
    Parameters
    Type Name Description
    System.Single averageColorTemperature

    An estimated color temperature.

    Returns
    Type Description
    System.Boolean

    true if average color temperature was provided. Otherwise, false.

    TryGetDisplayMatrix(out Matrix4x4)

    Provides display matrix defining how texture is being rendered on the screen.

    Declaration
    public bool TryGetDisplayMatrix(out Matrix4x4 displayMatrix)
    Parameters
    Type Name Description
    Matrix4x4 displayMatrix

    The display matrix for rendering.

    Returns
    Type Description
    System.Boolean

    true if the display matrix was provided. Otherwise, false.

    TryGetProjectionMatrix(out Matrix4x4)

    Provides projection matrix for the camera frame.

    Declaration
    public bool TryGetProjectionMatrix(out Matrix4x4 projectionMatrix)
    Parameters
    Type Name Description
    Matrix4x4 projectionMatrix

    The projection matrix used by the XRCameraSubsystem.

    Returns
    Type Description
    System.Boolean

    true if the projection matrix was provided. Otherwise, false.

    TryGetTimestamp(out Int64)

    Provides timestamp of the camera frame.

    Declaration
    public bool TryGetTimestamp(out long timestampNs)
    Parameters
    Type Name Description
    System.Int64 timestampNs

    The timestamp of the camera frame.

    Returns
    Type Description
    System.Boolean

    true if the timestamp was provided. Otherwise, false.

    Operators

    Equality(XRCameraFrame, XRCameraFrame)

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

    Inequality(XRCameraFrame, XRCameraFrame)

    Declaration
    public static bool operator !=(XRCameraFrame lhs, XRCameraFrame rhs)
    Parameters
    Type Name Description
    XRCameraFrame lhs
    XRCameraFrame rhs
    Returns
    Type Description
    System.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