目录

ARImage

Class Info

public class ARImage extends ImageAdapter

实现Android里面的Image类,用于描述ARFrame获取到的预览图等Image信息,通过此类可以获取图片格式、宽高等信息。

Public Constructor Summary

Constructor Name

ARImage(long nativeHandle)

通过传入的ARFrame数据流创建ARImage对象,在使用时应直接使用ARFrame.acquireXXXImage()获取对应帧的ARImage对象。

Public Method Summary

Qualifier and Type

Method Name and Description

void

close()

关闭ARImage数据流,在使用完成以后使用。

Rect

getCropRect()

不支持在此对象上操作。

int

getFormat()

获取图片格式,主要参见Android的Image对象格式。

int

getHeight()

获取图像高度。

Plane[]

getPlanes()

获取图像的YUV分量,返回的数组长度是3,分别存储Y、U、V数据。

long

getTimestamp()

获取图片的时间戳。

int

getWidth()

获取图像宽度。

void

setCropRect(Rect var)

不支持在此对象上操作。

void

setTimestamp(long var)

不支持在此对象上操作。

Public Constructors

[h2]ARImage

Constructor

public ARImage(long nativeHandle)

通过传入的ARFrame数据流创建ARImage对象,在使用时应直接使用ARFrame.acquireXXXImage()获取对应帧的ARImage对象。

Parameters

Name

Description

nativeHandle

ARFrame数据存储句柄。

Public Methods

[h2]close

Method

public void close()

关闭ARImage数据流,在使用完成以后使用。

[h2]getCropRect

Method

public Rect getCropRect()

不支持在此对象上操作。

Throws

Name

Description

UnsupportedOperationException

操作不支持。

[h2]getFormat

Method

public int getFormat()

获取图片格式,主要参见Android的Image对象格式。

Throws

Name

Description

ARFatalException

传入的图像为空或格式不正确。

Returns

Type

Description

int

ARImage格式。

[h2]getHeight

Method

public int getHeight()

获取图像高度。

Throws

Name

Description

ARFatalException

传入的图像为空或格式不正确。

Returns

Type

Description

int

图像高度。

[h2]getPlanes

Method

public Plane[] getPlanes()

获取图像的YUV分量,返回的数组长度是3,分别存储Y、U、V数据。

Throws

Name

Description

ARFatalException

传入的图像为空或格式不正确。

Returns

Type

Description

Plane[]

获取图像的YUV分量,数组大小为3,分别表示图像的Y、U、V分量。

[h2]getTimestamp

Method

public long getTimestamp()

获取图片的时间戳。

Throws

Name

Description

ARFatalException

传入的图像为空或格式不正确。

Returns

Type

Description

long

当前帧对应的时间戳。

[h2]getWidth

Method

public int getWidth()

获取图像宽度。

Throws

Name

Description

ARFatalException

传入的图像为空或格式不正确。

Returns

Type

Description

int

图像宽度。

[h2]setCropRect

Method

public void setCropRect(Rect var)

不支持在此对象上操作。

Throws

Name

Description

UnsupportedOperationException

操作不支持。

[h2]setTimestamp

Method

public void setTimestamp(long var)

不支持在此对象上操作。

Throws

Name

Description

UnsupportedOperationException

操作不支持。