asBitmap

fun asBitmap(format: Int, buffer: ByteBuffer?, width: Int, height: Int): Bitmap?

Converts a YUV 420 to ByteBuffer if possible.

Return

null if conversion fails.

Parameters

format

Image format, this should be an EImagePixelFormat as int

buffer

The buffer that keeps the image.

width

The width of the image.

height

The height of the image.

See also


fun asBitmap(format: EImagePixelFormat, buffer: ByteBuffer?, width: Int, height: Int): Bitmap?
fun asBitmap(format: EImagePixelFormat, buffer: ByteArray?, width: Int, height: Int): Bitmap?

Converts a YUV 420 to ByteBuffer if possible.

Return

null if conversion fails.

Parameters

format

Image format

buffer

The buffer that keeps the image.

width

The width of the image.

height

The height of the image.

See also


fun asBitmap(encoding: Bitmap.Config, img: ByteArray, width: Int, height: Int): Bitmap?

Creates an android.graphics.Bitmap based on provided ByteArray that contains image.

Parameters

encoding

Encoding of the image.

img

Image data as ByteBuffer.

width

Image width in px.

height

Image height in px.


fun asBitmap(encoding: Bitmap.Config, buffer: ByteBuffer?, width: Int, height: Int): Bitmap?

Creates an android.graphics.Bitmap based on provided ByteArray that contains image.

Parameters

encoding

Encoding of the image.

buffer

Image data as ByteArray.

width

Image width in px.

height

Image height in px.