RenderTextureOutput
class NatML.Devices.Outputs.RenderTextureOutput : CameraOutput
The RenderTextureOutput
streams CameraImage
instances into a RenderTexture
.
Unlike the TextureOutput
, this output performs all conversions on the GPU. As such, it typically has better performance when pixel data access is not needed.
The RenderTextureOutput
is not supported on WebGL, due to a lack of support for compute shaders on the platform.
Creating the Output
The render texture output is trivially constructed.
Specifying the Orientation
The render texture output supports specifying the desired output orientation of the converted texture.
This property is especially useful on mobile devices where camera images are always returned in the "natural orientation" of the camera device.
This property is only supported on Android and iOS.
Updating with New Images
The output will upload the CameraImage
into a RenderTexture
. The output supports specifying options that are used when converting the image:
The provided options
can be null
, in which case reasonable defaults are used.
Conversion Options
The ConversionOptions
expose some options that can be used when performing the conversion.
Accessing the Texture
When the output has been updated with a CameraImage
, the texture
will contain the converted pixel data in the correct pixel format and orientation on the GPU.
Disposing the Output
Refer to the Disposing the Output section of the CameraOutput
class for more information.
Last updated