CameraImageRenderer Class

Description

MonoBehaviour which controls camera image rendering in the scene. Only effective when FrameSource.IsCameraUnderControl of session frame source is true.


MonoBehaviour Messages

protected virtual void Awake()

protected virtual void OnEnable()

protected virtual void OnDisable()

protected virtual void OnDestroy()


Events

OnFrameRenderUpdate

C#

public event Action< Material , Vector2 > OnFrameRenderUpdate

Camera image rendering update event. This event will pass out the Material and texture size of current camera image rendering. This event only indicates a new render happens, while the camera image itself may not change.


Methods

RequestTargetTexture

C#

public void RequestTargetTexture(Action< Camera , RenderTexture > targetTextureEventHandler)

Get the RenderTexture of camera image.

The texture is a full sized image from OutputFrame , not cropped by the screen. The action targetTextureEventHandler will pass out the RenderTexture and the Camera drawing the texture when the texture created or changed, will not call every frame or when the camera image data change. Calling this method will create external resources, and will trigger render when necessary, so make sure to release the resource using CameraImageRenderer.DropTargetTexture when not use.

DropTargetTexture

C#

public void DropTargetTexture(Action< Camera , RenderTexture > targetTextureEventHandler)

Release the RenderTexture of camera image. Internal resources will be released when all holders release.