Class CameraImageRenderer
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
A MonoBehaviour that controls camera image rendering in the scene. It is valid only when the session frame source IsCameraUnderControl is true.
[DisallowMultipleComponent]
public class CameraImageRenderer : MonoBehaviour
- Inheritance
-
CameraImageRenderer
Properties
enabled
Enables/disables camera image rendering while ARSession is running, if it is controlled by EasyAR.
public bool enabled { get; set; }
Methods
DropTargetTexture(Action<Camera, RenderTexture>)
Releases the RenderTexture used to draw the camera image. Internal resources will be released after all holders have released them.
public void DropTargetTexture(Action<Camera, RenderTexture> targetTextureEventHandler)
Parameters
targetTextureEventHandler
RequestTargetTexture(Action<Camera, RenderTexture>)
Gets the RenderTexture for the camera image.
The texture obtained through this interface is the full-size image from easyar.OutputFrame, without screen cropping. The targetTextureEventHandler action passes out the RenderTexture and the Camera used to draw the texture. This action is not called every frame and is not called when camera image data changes; it occurs only when the texture itself is created or changed. Calling this method creates additional resources and triggers rendering when necessary, so when it is no longer used, call DropTargetTexture(Action<Camera, RenderTexture>) to release resources.
public void RequestTargetTexture(Action<Camera, RenderTexture> targetTextureEventHandler)
Parameters
targetTextureEventHandler
Events
OnFrameRenderUpdate
Event for camera image rendering updates. This event passes out the material currently used for camera image rendering and the texture size. When this event occurs, the camera image itself may not have changed; it only indicates that one rendering has occurred.
public event Action<Material, Vector2> OnFrameRenderUpdate