BitmapUtils

open class BitmapUtils

Utils functions for bitmap conversions.

See also

<a href="https://github.com/googlesamples/mlkit/blob/master/android/vision-quickstart/app/src/main/java/com/google/mlkit/vision/demo/BitmapUtils.java">BitmapUtils</a>

Functions

Link copied to clipboard
Converts a YUV_420_888 image from CameraX API to a bitmap.
open fun getBitmap(nv21Data: Array<Byte>, frameMetadata: FrameMetadata): Bitmap
Converts NV21 format byte to bitmap.
open fun getBitmap(data: ByteBuffer, width: Int, height: Int, rotationDegrees: Int): Bitmap
Converts NV21 format byte buffer to bitmap.
Link copied to clipboard
Link copied to clipboard
open fun yuv420ThreePlanesToNV21(yuv420888planes: Array<Image.Plane>, width: Int, height: Int): Array<Byte>
Converts YUV_420_888 to NV21 bytes.