PixelBufferOutput
class NatML.Devices.Outputs.PixelBufferOutput : CameraOutput
The PixelBufferOutput
converts CameraImage
instances into RGBA8888
pixel buffers.
Creating the Output
The output is trivially constructed.
Specifying Orientation
The pixel buffer output supports specifying the desired output orientation of the converted pixel buffer.
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 convert the CameraImage
into an RGBA8888
pixel buffer. The output handles all formats supported by the camera image. 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 Pixel Buffer
When the output has been updated with a CameraImage
, the pixelBuffer
will contain the converted pixel data in the correct pixel format and orientation.
The pixel buffer always has an RGBA8888
pixel layout.
Inspecting the Pixel Buffer
The output exposes details about converted pixel buffers:
Pixel Buffer Width
The pixel buffer output provides the width
of the converted pixel buffer.
Note that the width
of the converted pixel buffer depends on the requested orientation
.
Pixel Buffer Height
The pixel buffer output provides the height
of the converted pixel buffer.
Note that the height
of the converted pixel buffer depends on the requested orientation
.
Disposing the Output
Refer to the Disposing the Output section of the CameraOutput
class for more information.
Last updated