| class info |
| com.huawei.hms.mlsdk.common.MLFrame.Creator |
| Represents a frame creator. |
| Constructor name |
| Creator() Instantiates MLFrame.Creator. |
| Return type | Method name |
| MLFrame | create() |
| MLFrame.Creator | setBitmap(android.graphics.Bitmap bitmap) |
| MLFrame.Creator | setFramePropertyExt(MLFrame.Property.Ext ext) |
| MLFrame.Creator | setItemIdentity(int itemIdentity) |
| MLFrame.Creator | setQuadrant(int quad) |
| MLFrame.Creator | setTimestamp(long timestamp) |
| MLFrame.Creator | writeByteBufferData(java.nio.ByteBuffer data, int width, int height, int formatType) |
| Method |
| public Creator() |
| Instantiates MLFrame.Creator. |
| Method |
| public MLFrame create() |
| Creates a frame instance. |
Return
| Type | desc |
| MLFrame | An 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 name | Parameter desc |
| bitmap | Bitmap data of an image. |
Return
| Type | desc |
| MLFrame.Creator | An instance of MLFrame.Creator. |
| Method |
| public MLFrame.Creator setFramePropertyExt(MLFrame.Property.Ext ext) |
| Sets camera parameters. |
Parameters
| Parameter name | Parameter desc |
| ext | Extended camera attributes, including the maximum focal length supported by the camera and focal length used when the current frame is generated. |
Return
| Type | desc |
| MLFrame.Creator | An instance of MLFrame.Creator. |
| Method |
| public MLFrame.Creator setItemIdentity(int itemIdentity) |
| Sets a frame ID. |
Parameters
| Parameter name | Parameter desc |
| itemIdentity | Frame ID. The camera uses a unique ID to number each generated frame in sequence by an increment of 1. |
Return
| Type | desc |
| MLFrame.Creator | An instance of MLFrame.Creator. |
| Method |
| public MLFrame.Creator setQuadrant(int quad) |
| Sets the screen orientation. |
Parameters
| Parameter name | Parameter desc |
| quad | Screen orientation. The options are as follows: 0: landscape 1: portrait 2: reverse landscape 3: reverse portrait |
Return
| Type | desc |
| MLFrame.Creator | An instance of MLFrame.Creator. |
Parameters
| Parameter name | Parameter desc |
| timestamp | Timestamp of a frame. |
Return
| Type | desc |
| MLFrame.Creator | An 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 name | Parameter desc |
| data | Image data. |
| width | Frame width, in pixels. |
| height | Frame height, in pixels. |
| formatType | Frame format. |
Return
| Type | desc |
| MLFrame.Creator | An instance of MLFrame.Creator. |