Skip to content
Select language:English

ARDK 1.5.6

Reads the current camera frame.

Instances of this class are provided by CameraSession.requestCameraFrame. The callback passed to that method is invoked on the rendering thread, therefore all operations performed by this class are executed on the rendering thread as well.

Reading and converting camera frames can be computationally expensive. For this reason, applications should avoid calling its methods directly from the rendering thread. Instead, the callback should schedule the frame reading on a background thread or coroutine dispatcher and return as quickly as possible.

While a CameraFrameReader is being used to read the captured frame, no additional calls to CameraSession.requestCameraFrame should be made. A new camera frame should only be requested after the current CameraFrameReader has finished reading the frame.

Functions

Gets the camera intrinsics.

fun readImage(format: CameraFrame.Format, maxShortestSide: Int = 0, quality: Int = 90): CameraFrame

Reads the current camera frame and converts it to the requested format.

fun yToRgb(y: ByteArray, width: Int, height: Int, yRowStride: Int, fullRange: Boolean, format: CameraFrame.Format): ByteArray

Converts the luminance plane of a YUV image to an RGB888 grayscale image.