Skip to content
Select language:English

ARDK 1.5.6

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

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

This operation may involve copying and converting the camera image and can therefore be expensive. It should normally be executed on a background thread rather than on the rendering thread.

Return

The captured camera frame.

Parameters

format

The desired output image format.

maxShortestSide

Maximum size, in pixels, of the image's shortest side. A value of 0 disables resizing. Images whose shortest side is already smaller than or equal to this value are also preserved without resizing. This parameter applies only when format is CameraFrame.Format.JPEG or CameraFrame.Format.PNG.

quality

The compression quality used when format is CameraFrame.Format.JPEG.