NRSDKApiForUnity
Classes
XRXREALPhotoCaptureFrame
Unity.XR.XREAL.PhotoCaptureFramesealed

Public Member Functions

 PhotoCaptureFrame (CapturePixelFormat format, byte[] data)
 
void CopyRawImageDataIntoBuffer (List< byte > byteBuffer)
 
void Dispose ()
 
IntPtr GetUnsafePointerToBuffer ()
 
bool TryGetCameraToWorldMatrix (out Matrix4x4 cameraToWorldMatrix)
 
bool TryGetProjectionMatrix (out Matrix4x4 projectionMatrix)
 
bool TryGetProjectionMatrix (float nearClipPlane, float farClipPlane, out Matrix4x4 projectionMatrix)
 
void UploadImageDataToTexture (Texture2D targetTexture)
 

Properties

int dataLength [get]
 
bool hasLocationData [get]
 
CapturePixelFormat pixelFormat [get]
 
byte[] TextureData [get]
 

Detailed Description

Contains information captured from the web camera.

Constructor & Destructor Documentation

◆ PhotoCaptureFrame()

Unity.XR.XREAL.PhotoCaptureFrame.PhotoCaptureFrame ( CapturePixelFormat format,
byte[] data )

Constructor.

Parameters
formatDescribes the format to use.
dataThe data.

Member Function Documentation

◆ CopyRawImageDataIntoBuffer()

void Unity.XR.XREAL.PhotoCaptureFrame.CopyRawImageDataIntoBuffer ( List< byte > byteBuffer)

Copies the raw image data into buffer described by byteBuffer.

Parameters
byteBufferBuffer for byte data.

◆ GetUnsafePointerToBuffer()

IntPtr Unity.XR.XREAL.PhotoCaptureFrame.GetUnsafePointerToBuffer ( )

Provides a COM pointer to the native IMFMediaBuffer that contains the image data.

Returns
A native COM pointer to the IMFMediaBuffer which contains the image data.

◆ TryGetCameraToWorldMatrix()

bool Unity.XR.XREAL.PhotoCaptureFrame.TryGetCameraToWorldMatrix ( out Matrix4x4 cameraToWorldMatrix)

Attempts to get camera to world matrix.

Parameters
cameraToWorldMatrix[out] The camera to world matrix.
Returns
True if it succeeds, false if it fails.

◆ TryGetProjectionMatrix() [1/2]

bool Unity.XR.XREAL.PhotoCaptureFrame.TryGetProjectionMatrix ( float nearClipPlane,
float farClipPlane,
out Matrix4x4 projectionMatrix )

Attempts to get projection matrix.

Parameters
nearClipPlaneThe near clip plane.
farClipPlaneThe far clip plane.
projectionMatrix[out] The projection matrix.
Returns
True if it succeeds, false if it fails.

◆ TryGetProjectionMatrix() [2/2]

bool Unity.XR.XREAL.PhotoCaptureFrame.TryGetProjectionMatrix ( out Matrix4x4 projectionMatrix)

Attempts to get projection matrix.

Parameters
projectionMatrix[out] The projection matrix.
Returns
True if it succeeds, false if it fails.

◆ UploadImageDataToTexture()

void Unity.XR.XREAL.PhotoCaptureFrame.UploadImageDataToTexture ( Texture2D targetTexture)

This method will copy the captured image data into a user supplied texture for use in Unity.

Parameters
targetTextureThe target texture that the captured image data will be copied to.

Property Documentation

◆ dataLength

int Unity.XR.XREAL.PhotoCaptureFrame.dataLength
get

The length of the raw IMFMediaBuffer which contains the image captured.

The length of the data.

◆ hasLocationData

bool Unity.XR.XREAL.PhotoCaptureFrame.hasLocationData
get

Specifies whether or not spatial data was captured.

True if this object has location data, false if not.

◆ pixelFormat

CapturePixelFormat Unity.XR.XREAL.PhotoCaptureFrame.pixelFormat
get

The raw image data pixel format.

The pixel format.

◆ TextureData

byte [] Unity.XR.XREAL.PhotoCaptureFrame.TextureData
get

texture data

Returns