layout | title | description | keywords | needAutoGenerateSidebar | noTitleIndex | needGenerateH3Content | breadcrumbText | permalink |
---|---|---|---|---|---|---|---|---|
default-layout |
Android DCEFrame Class - Dynamsoft Camera Enhancer Documents |
This is the documentation - Android DCEFrame Class page of Dynamsoft Camera Enhancer. |
Camera Enhancer, Android, DCEFrame |
true |
true |
true |
Android DCEFrame Class |
/programming/android/auxiliary-api/dceframe-v3.0.3.html |
You are viewing a historical document page of Dynamsoft Camera Enhancer v3.0.3.
The DCEFrame
is the class that stores pixel data and further information.
class com.dynamsoft.dce.DCEFrame
Method Name | Description |
---|---|
getImageData |
Get the pixel data of the image. |
getWidth |
Get the pixel width of the image. |
getHeight |
Get the pixel height of the image. |
getStrides |
Get the number of row bytes in each image plane (YUV). |
getPixelFormat |
Get the pixel format of the image. Currently, the image output format of DCEFrame is always NV21. |
getFrameID |
Get the frameID of the DCEFrame object. |
getQuality |
Get the frame quality of the image. User have to enable the frame filter feature to get the quality (high/low) of the image. Otherwise, the frame quality will be unknown. |
getIsCropped |
Get a boolean value that means whether the image is cropped. The frames can be cropped if fast mode is enabled. |
getCropRegion |
Get the crop region of the image (if the image is cropped). |
getOrientation |
Set the orientation of the image. |
setImageData |
Set the pixel data of the image. |
setWidth |
Set the pixel width of the image. |
setHeight |
Set the pixel height of the image. |
setStrides |
Set the number of row bytes in each image plane (YUV). |
setPixelFormat |
Set the pixel format of the image. Currently, the image output format of DCEFrame is always NV21. |
setFrameID |
Set the frameID of the DCEFrame object. |
setQuality |
Set the frame quality of the image. User have to enable the frame filter feature to get the quality (high/low) of the image. Otherwise, the frame quality will be unknown. |
setIsCropped |
Set a boolean value that means whether the image is cropped. The frames can be cropped if fast mode is enabled. |
setCropRegion |
Set a boolean value that means whether the image is cropped. The frames can be cropped if fast mode is enabled. |
setOrientation |
Set the orientation of the image. |
toBitmap |
The method converts the image to Bitmap . |
Get the pixel data of the image.
byte[] getImageData()
Return Value
The method returns a byte list that stores the pixel data of the image.
Get the pixel width of the image.
int getWidth()
Return Value
The method returns the pixel width of the image.
Get the pixel height of the image.
int getHeight()
Return Value
The method returns the pixel height of the image.
Get the number of row bytes in each image plane (YUV).
int[] getStrides()
Return Value
The number of row bytes in each image plane (YUV).
Remarks
strides[0]
is the stride of Y component in the image. strides[1]
and strides[2]
are the strides of the U (blue projection) and V (red projection) components in the image.
Get the pixel format of the image. Currently, the image output format of DCEFrame
is always NV21.
int getPixelFormat()
Return Value
The method returns an int value that refers to the pixel format of the image. View morein [EnumImagePixelFormat
]({{ site.core-enums }}image-pixel-format.html?src=android).
Get the frameID
of the DCEFrame
object.
int getFrameID()
Return Value
The method returns an int value that stores the frameID
of the image.
Get the frame quality of the image. User have to enable the frame filter feature to get the quality (high/low) of the image. Otherwise, the frame quality will be unknown.
EnumFrameQuality getQuality()
Return Value
The method returns an enumeration value in [EnumFrameQuality
]({{ site.dce-enums }}video-frame-quality.html).
Remarks
Users can get all the original DCEFrame via DCEFrameListener
but only high-quality frame can be acquired from the DCE video buffer if frame filter is enabled. In another word, when frame filter feature is enabled, the frame quality will always be high if they are acquired by triggering getFrameFromBuffer
.
Get a boolean value that means whether the image is cropped. The frames can be cropped if fast mode
is enabled.
boolean getIsCropped()
Return Value
A boolean value. True
means the image is cropped and false
means the image has never been cropped.
Get the crop region of the image (if the image is cropped).
Rect getCropRegion()
Return Value
A Rect value that stores the crop region. If the image is not cropped, the value will be null.
Set the orientation of the image.
int getOrientation()
Return Value
Int value that means the rotation angle of the image. The value is 0, 90, 180 or 270 with depends on the device orientation.
Set the pixel data of the image.
void setImageData(byte[] imageData)
Parameters
imageData
: A byte list that storing the image pixel data.
Set the pixel width of the image.
void setWidth(int width)
Parameters
width
: The pixel value that stands for the width of the image.
Set the pixel height of the image.
void setHeight(int height)
Parameters
height
: The pixel value that stands for the height of the image.
Set the number of row bytes in each image plane.
void setStrides(int[] strides)
Parameters
strides
: The number of row bytes in each image plane.
Set the pixel format of the image.
void setPixelFormat(int pixelFormat)
Parameters
pixelFormat
: The pixelFormat of the image. View more in [EnumImagePixelFormat
]({{ site.core-enums }}image-pixel-format.html?src=android).
Set the frameID
of the image.
void setFrameID(int frameID)
Parameters
frameID
: An int value that stands for the frameID
of the image.
Set the frame quality of the image.
void setQuality(EnumFrameQuality quality)
Parameters
quality
: One of the [EnumFrameQuality
]({{ site.dce-enums }}video-frame-quality.html) value that indicates the frame quality.
Set whether the image is cropped.
void setIsCropped(boolean isCropped)
Parameters
isCropped
: A boolean value that means whether the image is cropped.
Set the crop region of the image (if the frame is cropped).
void setCropRegion(Rect region)
Parameters
cropRegion
: A Rect value that means crop area of the image (if the frame is cropped).
Set the orientation of the image.
void setOrientation(int orientation)
Parameters
orientation
: Int value that means the rotation angle of the image.
The method converts the image to Bitmap
.
Bitmap toBitmap()
Return Value
The converted image.
Code Snippet
Bitmap frame = DCEFrame.toBitmap();