Class CameraImageRenderer
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
Control the camera image rendering in the scene's MonoBehaviour. Only valid when the session's frame sourceIsCameraUnderControl is true.
[DisallowMultipleComponent]
public class CameraImageRenderer : MonoBehaviour
- Inheritance
-
CameraImageRenderer
Methods
DropTargetTexture(Action<Camera, RenderTexture>)
Release the RenderTexture used to draw the camera image. Internal resources will be released after all holders have released.
public void DropTargetTexture(Action<Camera, RenderTexture> targetTextureEventHandler)
Parameters
targetTextureEventHandler
RequestTargetTexture(Action<Camera, RenderTexture>)
Get the RenderTexture of the camera image.
The texture obtained through this interface is the full - size image obtained from easyar.OutputFrame, without screen cropping. The targetTextureEventHandler action will pass the RenderTexture and the Camera used to draw the texture. This action is not called every frame nor when the camera image data changes; it only occurs when the texture itself is created or changed. Calling this method will create additional resources and trigger rendering when necessary. Therefore, when not in use, you need to call DropTargetTexture(Action<Camera, RenderTexture>) to release resources.
public void RequestTargetTexture(Action<Camera, RenderTexture> targetTextureEventHandler)
Parameters
targetTextureEventHandler
Events
OnFrameRenderUpdate
Event for camera image rendering update. This event will pass the current material and texture size used for camera image rendering. When this event occurs, the camera image itself may not change; it only indicates that a rendering has occurred.
public event Action<Material, Vector2> OnFrameRenderUpdate