BitmapUtilities

open class BitmapUtilities

Helper class for handling Bitmap files.

Functions

compressBitmap
Link copied to clipboard
open fun compressBitmap(bitmap: Bitmap, format: Bitmap.CompressFormat): Array<Byte>
Compresses the bitmap to JPEG format and returns byte arrays
getBitmap
Link copied to clipboard
open fun getBitmap(image: ImageProxy): Bitmap
Converts the image to a bitmap and rotates to the correct orientation basedon the rotation degrees from the image
getBitmapFromBuffer
Link copied to clipboard
open fun getBitmapFromBuffer(data: ByteBuffer, metadata: FrameMetadata): Bitmap
Converts NV21 format byte buffer to bitmap.
getBitmapFromImageProxy
Link copied to clipboard
open fun getBitmapFromImageProxy(image: ImageProxy): Bitmap
Converts a YUV_420_888 image from CameraX API to a bitmap.