Class Info |
|---|
public class ARImage extends ImageAdapter 实现Android里面的Image类,用于描述ARFrame获取到的预览图等Image信息,通过此类可以获取图片格式、宽高等信息。 |
Qualifier and Type | Method Name and Description |
|---|---|
void | close() 关闭ARImage数据流,在使用完成以后使用。 |
Rect | 不支持在此对象上操作。 |
int | 获取图片格式,主要参见Android的Image对象格式。 |
int | 获取图像高度。 |
Plane[] | 获取图像的YUV分量,返回的数组长度是3,分别存储Y、U、V数据。 |
long | 获取图片的时间戳。 |
int | getWidth() 获取图像宽度。 |
void | setCropRect(Rect var) 不支持在此对象上操作。 |
void | setTimestamp(long var) 不支持在此对象上操作。 |
Constructor |
|---|
public ARImage(long nativeHandle) 通过传入的ARFrame数据流创建ARImage对象,在使用时应直接使用ARFrame.acquireXXXImage()获取对应帧的ARImage对象。 |
Parameters
Name | Description |
|---|---|
nativeHandle | ARFrame数据存储句柄。 |
Method |
|---|
public Rect getCropRect() 不支持在此对象上操作。 |
Throws
Name | Description |
|---|---|
UnsupportedOperationException | 操作不支持。 |
Method |
|---|
public int getFormat() 获取图片格式,主要参见Android的Image对象格式。 |
Throws
Name | Description |
|---|---|
传入的图像为空或格式不正确。 |
Returns
Type | Description |
|---|---|
int | ARImage格式。 |
Method |
|---|
public int getHeight() 获取图像高度。 |
Throws
Name | Description |
|---|---|
传入的图像为空或格式不正确。 |
Returns
Type | Description |
|---|---|
int | 图像高度。 |
Method |
|---|
public Plane[] getPlanes() 获取图像的YUV分量,返回的数组长度是3,分别存储Y、U、V数据。 |
Throws
Name | Description |
|---|---|
传入的图像为空或格式不正确。 |
Returns
Type | Description |
|---|---|
Plane[] | 获取图像的YUV分量,数组大小为3,分别表示图像的Y、U、V分量。 |
Method |
|---|
public long getTimestamp() 获取图片的时间戳。 |
Throws
Name | Description |
|---|---|
传入的图像为空或格式不正确。 |
Returns
Type | Description |
|---|---|
long | 当前帧对应的时间戳。 |
Method |
|---|
public int getWidth() 获取图像宽度。 |
Throws
Name | Description |
|---|---|
传入的图像为空或格式不正确。 |
Returns
Type | Description |
|---|---|
int | 图像宽度。 |