asBitmap

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

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

Parameters

img

Image data as ByteBuffer.

width

Image width in px.

height

Image height in px.


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(byteBuffer: ByteBuffer?, width: Int, height: Int): Bitmap?

Creates a Bitmap based on input buffer with format Bitmap.Config.ARGB_8888

Parameters

byteBuffer

Input buffer.

width

Image width.

height

Image height.


fun asBitmap(iBitmap: IBitmap): Bitmap?

Converts an IBitmap to Bitmap

Parameters

iBitmap

The input image.


fun asBitmap(imageId: Int, width: Int, height: Int): Bitmap?

Takes a Image by id from ImageDatabase and converts it to a Bitmap.

Parameters

imageId

The image id.


fun asBitmap(img: Image?, width: Int, height: Int): Bitmap?

Converts a Image to Bitmap.


fun asBitmap(img: AbstractGeometryImage?, width: Int, height: Int, activeInnerColor: Rgba? = null, activeOuterColor: Rgba? = null, inactiveInnerColor: Rgba? = null, inactiveOuterColor: Rgba? = null): Bitmap?

Converts an image to Bitmap


fun asBitmap(image: SignpostImage?, width: Int, height: Int): Pair<Int, Bitmap?>

Converts SignpostImage as an Bitmap.

Return

pair of result width, actual bitmap. Note. if width is 0 then it will be auto calculated and returned in result pair.

Parameters

width

Desired width. If 0 it a width will be provided as result.

height

Desired height. Can't be 0.


fun asBitmap(image: RoadInfoImage?, width: Int, height: Int): Pair<Int, Bitmap?>

Converts RoadInfoImage as an Bitmap.

Return

pair of result width, actual bitmap. Note. if width is 0 then it will be auto calculated and returned in result pair.

Parameters

width

Desired width. If 0 it a width will be provided as result.

height

Desired height. Can't be 0.


fun asBitmap(image: LaneImage?, width: Int, height: Int, bkColor: Rgba? = null, activeColor: Rgba? = null, inactiveColor: Rgba? = null): Pair<Int, Bitmap?>

Converts input LaneImage to Bitmap

Return

PairBitmap>