Class RenderTextureReader<T>
RenderTextureReader reads a RenderTexture from the GPU each frame and passes the data back through a provided callback.
Inherited Members
Namespace: UnityEngine.Perception.GroundTruth
Syntax
public class RenderTextureReader<T> : IDisposable where T : struct
Type Parameters
Name | Description |
---|---|
T | The type of the raw texture data to be provided. |
Constructors
RenderTextureReader(RenderTexture, Camera, Action<Int32, NativeArray<T>, RenderTexture>)
Creates a new RenderTextureReader<T> for the given RenderTexture, Camera, and image readback callback
Declaration
public RenderTextureReader(RenderTexture source, Camera cameraRenderingToSource, Action<int, NativeArray<T>, RenderTexture> imageReadCallback)
Parameters
Type | Name | Description |
---|---|---|
RenderTexture | source | The RenderTexture to read from. |
Camera | cameraRenderingToSource | The Camera which renders to the given renderTexture. This is used to determine when to read from the texture. |
Action<Int32, NativeArray<T>, RenderTexture> | imageReadCallback | The callback to call after reading the texture |
Methods
Dispose()
Shut down the reader, waiting for all requests to return.
Declaration
public void Dispose()
Implements
WaitForAllImages()
Synchronously wait for all image requests to complete.
Declaration
public void WaitForAllImages()