public abstract class Frame extends Object
byte[]
and
Bitmap
).Modifier and Type | Class and Description |
---|---|
static class |
Frame.BitmapFrame
A class to wrap an image in a
Bitmap format to a Frame readable by the SDK. |
static class |
Frame.ByteArrayFrame
A class to wrap an image in a byte array format to a
Frame readable by the SDK. |
static class |
Frame.COLOR_FORMAT
Defines the
Frame 's color format. |
static class |
Frame.ROTATE
Defines the desired rotation before processing.
|
Modifier and Type | Field and Description |
---|---|
protected Frame.COLOR_FORMAT |
colorFormat |
protected android.graphics.Bitmap |
originalBitmap |
protected static String |
TAG |
Constructor and Description |
---|
Frame() |
Modifier and Type | Method and Description |
---|---|
Frame.COLOR_FORMAT |
getColorFormat()
Get
Frame 's color format. |
abstract int |
getHeight()
Get
Frame 's height. |
android.graphics.Bitmap |
getOriginalBitmapFrame()
Get the
Bitmap that was used to create this frame, if any. |
int |
getPixelCount()
Get total number of pixels in
Frame . |
Frame.ROTATE |
getTargetRotation()
Get
Frame 's rotation angle. |
abstract int |
getWidth()
Get
Frame 's width. |
void |
revertPointRotation(android.graphics.PointF[] points)
Revert points to the
Frame 's original coordinate space. |
static void |
revertPointRotation(android.graphics.PointF[] points,
int width,
int height,
Frame.ROTATE targetRot)
Revert points to
Frame 's original coordinate space |
static android.graphics.Bitmap |
rotateImage(android.graphics.Bitmap src,
float angleDegrees)
Rotate a
Bitmap . |
void |
setTargetRotation(Frame.ROTATE targetRotation)
Set
Frame 's rotation angle. |
protected static final String TAG
protected Frame.COLOR_FORMAT colorFormat
protected android.graphics.Bitmap originalBitmap
public static android.graphics.Bitmap rotateImage(android.graphics.Bitmap src, float angleDegrees)
Bitmap
. Utility function to use before sending images to be processed by the SDK.
Note: if calling with large Bitmap on low-memory devices, may run out of memory.
angleDegrees
- the degrees to rotate the imagesrc
- Bitmap to apply the rotation onNullPointerException
- if src
is null
.public android.graphics.Bitmap getOriginalBitmapFrame()
Bitmap
that was used to create this frame, if any.public abstract int getWidth()
Frame
's width.Frame
widthpublic abstract int getHeight()
Frame
's height.Frame
heightpublic int getPixelCount()
Frame
.public Frame.COLOR_FORMAT getColorFormat()
Frame
's color format.Frame
.Frame.COLOR_FORMAT
public Frame.ROTATE getTargetRotation()
Frame
's rotation angle.Frame
.Frame.ROTATE
public void setTargetRotation(Frame.ROTATE targetRotation)
Frame
's rotation angle.targetRotation
- rotation angle to be applied to the Frame
.public void revertPointRotation(android.graphics.PointF[] points)
Frame
's original coordinate space.points
- array of points to revert in placeNullPointerException
- if points
is null
.public static void revertPointRotation(android.graphics.PointF[] points, int width, int height, Frame.ROTATE targetRot)
Frame
's original coordinate spacepoints
- array of points to revert in placewidth
- width of original imageheight
- height of original imagetargetRot
- rotation used for processing the imageNullPointerException
- if points
is null
.Copyright © 2015. All rights reserved.