目录

class info
com.huawei.hms.mlsdk.common.MLFrame.Creator
Represents a frame creator.

Public Constructor Summary

Constructor name
Creator()
Instantiates MLFrame.Creator.

Public Method Summary

Return typeMethod name
MLFramecreate()
MLFrame.CreatorsetBitmap(android.graphics.Bitmap bitmap)
MLFrame.CreatorsetFramePropertyExt(MLFrame.Property.Ext ext)
MLFrame.CreatorsetItemIdentity(int itemIdentity)
MLFrame.CreatorsetQuadrant(int quad)
MLFrame.CreatorsetTimestamp(long timestamp)
MLFrame.CreatorwriteByteBufferData(java.nio.ByteBuffer data, int width, int height, int formatType)

Public Constructors

Method
public Creator()
Instantiates MLFrame.Creator.

Public Methods

Method
public MLFrame create()
Creates a frame instance.

Return

Typedesc
MLFrameAn instance of MLFrame.
Method
public MLFrame.Creator setBitmap(android.graphics.Bitmap bitmap)
Sets bitmap data of an image. Different image sizes are recommended when different algorithms are used for image processing. In addition, processing large images consumes more memory and CPU resources. It is recommended that the size of an input image be 4096 x 2160 or smaller.

Parameters

Parameter nameParameter desc
bitmapBitmap data of an image.


Return

Typedesc
MLFrame.CreatorAn instance of MLFrame.Creator.
Method
public MLFrame.Creator setFramePropertyExt(MLFrame.Property.Ext ext)
Sets camera parameters.

Parameters

Parameter nameParameter desc
extExtended camera attributes, including the maximum focal length supported by the camera
and focal length used when the current frame is generated.


Return

Typedesc
MLFrame.CreatorAn instance of MLFrame.Creator.
Method
public MLFrame.Creator setItemIdentity(int itemIdentity)
Sets a frame ID.

Parameters

Parameter nameParameter desc
itemIdentityFrame ID. The camera uses a unique ID to number each generated frame in sequence by an increment of 1.


Return

Typedesc
MLFrame.CreatorAn instance of MLFrame.Creator.
Method
public MLFrame.Creator setQuadrant(int quad)
Sets the screen orientation.

Parameters

Parameter nameParameter desc
quadScreen orientation. The options are as follows:
0: landscape
1: portrait
2: reverse landscape
3: reverse portrait


Return

Typedesc
MLFrame.CreatorAn instance of MLFrame.Creator.
Method
public MLFrame.Creator setTimestamp(long timestamp)
Sets the timestamp of a frame. The timestamp records the number of milliseconds between the system start time and the frame generation time, including the deep sleep time of the device. The clock is monotonic, that is, the time is accumulated even when the CPU runs in power saving mode. If the required interval may cover system sleep time, the clock can be used.

Parameters

Parameter nameParameter desc
timestampTimestamp of a frame.


Return

Typedesc
MLFrame.CreatorAn instance of MLFrame.Creator.
Method
public MLFrame.Creator writeByteBufferData(java.nio.ByteBuffer data, int width, int height, int formatType)
Sets video frame data, including the image data and frame width, height, and format.

Parameters

Parameter nameParameter desc
dataImage data.
widthFrame width, in pixels.
heightFrame height, in pixels.
formatTypeFrame format.


Return

Typedesc
MLFrame.CreatorAn instance of MLFrame.Creator.