toBitmap

fun ImageProxy.toBitmap(applyRotation: Boolean = false): Bitmap

Converts an ImageProxy to a Bitmap. Currently only supports ImageFormat.YUV_420_888 and PixelFormat.RGBA_8888.

See also

Parameters

applyRotation

if true the resulting bitmap will be rotated to match target orientation of a use case.

Throws

if the input format is ImageFormat.YUV_420_888 and jpeg encoding of YuvImage fails.