onPreviewFrame

open fun onPreviewFrame(image: Image, rotationDegrees: Int)

Called as preview frames are displayed. This method should not close the image as this will be handled by the caller. This callback is invoked on a background thread but no intensive operation should be performed to avoid delaying other frame processing.

Parameters

image

the preview frame

rotationDegrees

the rotation needed to transform the image to the correct orientation. It will be a value in {0, 90, 180, 270}.