目录

class info
com.huawei.hms.mlsdk.common.MLFrame.Creator
帧构建器。

Public Constructor Summary

Constructor name
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()
实例化帧构建器。

Public Methods

Method
public MLFrame create()
构建帧实例。

Return

Typedesc
MLFrame帧实例。
Method
public MLFrame.Creator setBitmap(android.graphics.Bitmap bitmap)
设置图片帧位图数据。不同算法对于处理的图片尺寸有不同的建议值,另外处理大图片会带来更多的内存和CPU消耗,建议输入图片大小不要超过4096*2160。

Parameters

Parameter nameParameter desc
bitmap图片帧位图数据。


Return

Typedesc
MLFrame.Creator帧构建器实例。
Method
public MLFrame.Creator setFramePropertyExt(MLFrame.Property.Ext ext)
设置帧相机参数。

Parameters

Parameter nameParameter desc
ext帧扩展属性(包括相机支持的最大焦距和当前帧生成时刻的相机焦距)。


Return

Typedesc
MLFrame.Creator帧构建器实例。
Method
public MLFrame.Creator setItemIdentity(int itemIdentity)
设置帧ID。

Parameters

Parameter nameParameter desc
itemIdentity帧ID:相机每生成一帧,都会对该帧进行编号,编号按次序不断加1,用于识别帧之间的生成次序。


Return

Typedesc
MLFrame.Creator帧构建器实例。
Method
public MLFrame.Creator setQuadrant(int quad)
设置帧相机屏幕方向。

Parameters

Parameter nameParameter desc
quad相机屏幕方向:
0:正向横屏
1:正向竖屏
2:反向横屏
3:反向竖屏


Return

Typedesc
MLFrame.Creator帧构建器实例。
Method
public MLFrame.Creator setTimestamp(long timestamp)
设置帧时间戳,帧时间戳:记录系统启动到帧生成的毫秒数,包含设备深度休眠的时间。该时钟被保证是单调的,即使CPU在省电模式下,该时间也会继续计时。           该时钟可以被使用在当测量时间间隔可能跨越系统睡眠的时间段。

Parameters

Parameter nameParameter desc
timestamp帧时间戳。


Return

Typedesc
MLFrame.Creator帧构建器实例。
Method
public MLFrame.Creator writeByteBufferData(java.nio.ByteBuffer data, int width, int height, int formatType)
设置视频帧数据(帧图像数据,图像宽度,高度和格式)。

Parameters

Parameter nameParameter desc
data视频帧图像数据。
width视频帧图像宽度,单位:像素。
height视频帧图像高度,单位:像素。
formatType视频帧图像数据格式。


Return

Typedesc
MLFrame.Creator帧构建器实例。