Frame.BitmapFrame, Frame.ByteArrayFrame, Frame.COLOR_FORMAT, Frame.ROTATE
colorFormat, originalBitmap, TAG
Constructor and Description |
---|
Frame.BitmapFrame(android.graphics.Bitmap bitmap,
Frame.COLOR_FORMAT colorFormat)
Constructs a
BitmapFrame that wraps the specified Bitmap . |
Modifier and Type | Method and Description |
---|---|
android.graphics.Bitmap |
getBitmap()
Get underlying
Bitmap object. |
int |
getHeight()
Get
Frame 's height. |
int |
getWidth()
Get
Frame 's width. |
void |
setBitmap(android.graphics.Bitmap bitmap,
Frame.COLOR_FORMAT colorFormat)
Set underlying
Bitmap object. |
Frame.ByteArrayFrame |
toByteArrayFrame()
Extract byte array from bitmap, be careful when using it, it allocates memory when needed.
|
getColorFormat, getOriginalBitmapFrame, getPixelCount, getTargetRotation, revertPointRotation, revertPointRotation, rotateImage, setTargetRotation
public Frame.BitmapFrame(android.graphics.Bitmap bitmap, Frame.COLOR_FORMAT colorFormat)
BitmapFrame
that wraps the specified Bitmap
. Default rotation is set
to Frame.ROTATE.NO_ROTATION
.
Notes:
#setBitmap(Bitmap, COLOR_FORMAT)
and
getBitmap()
.Bitmap
for processing purposes.bitmap
- a Bitmap
to put in the BitmapFrame
.colorFormat
- the Frame.COLOR_FORMAT
of the Bitmap
specified.NullPointerException
- if bitmap
is null
.public android.graphics.Bitmap getBitmap()
Bitmap
object.
Note: Might be a scaled down version if the Bitmap
is very large for processing.
Bitmap
objectpublic void setBitmap(android.graphics.Bitmap bitmap, Frame.COLOR_FORMAT colorFormat)
Bitmap
object. Keeps the rotation unchanged.
Note:
May scale down the Bitmap
for processing purposes.
bitmap
- Bitmap
to replace the current wrapped Bitmap
.colorFormat
- COLOR_FORMATNullPointerException
- if bitmap
is null
.public int getWidth()
Frame
Frame
's width.public int getHeight()
Frame
Frame
's height.public Frame.ByteArrayFrame toByteArrayFrame() throws IllegalArgumentException
Frame.ByteArrayFrame
will contain an array with all the pixel information.ByteArrayFrame
object filled with the pixel information.IllegalArgumentException
- if the color format doesn't match the wrapped Bitmap
's color format.Copyright © 2015. All rights reserved.