Table of Contents

Class InertialCameraDevice

命名空间
easyar

InertialCameraDevice实现了一个基于运动惯性的camera设备,输出 CameraTransformType 为FiveDofRotXZ的 InputFrame (包含图像、摄像机参数、时间戳、位姿转换矩阵和跟踪状态)。 创建之后,可以调用start/stop来开始和停止采集视频流数据。 当不再需要该设备时,可以调用close对其进行关闭。close之后不应继续使用。 InertialCameraDevice通过inputFrameSource输出 InputFrame ,应将inputFrameSource连接到 InputFrameSink 上进行使用。 bufferCapacity表示 InputFrame 缓冲的容量,如果有超过此数量的 InputFrame 从该设备中输出并且没有被释放,该设备将不再输出新的 InputFrame ,直到之前的 InputFrame 被释放。这可能造成画面卡住等问题。

InertialCameraDevice

构造函数

InertialCameraDevice

默认创建方法。

void easyar_InertialCameraDevice__ctor(easyar_InertialCameraDevice * * Return)
InertialCameraDevice()
public InertialCameraDevice()
constructor()
+ (easyar_InertialCameraDevice *) create
public convenience init()
public InertialCameraDevice()

方法

isAvailable

检查是否可用。只在Android 7.0及上(API Level 24+)且加速度计、陀螺仪、姿态传感器可用时返回true。

bool easyar_InertialCameraDevice_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
+ (bool)isAvailable
public static func isAvailable() -> Bool
public static bool isAvailable()

返回

类型 描述
Boolean

bufferCapacity

InputFrame 缓冲的容量,默认值为8。

int easyar_InertialCameraDevice_bufferCapacity(const easyar_InertialCameraDevice * This)
int bufferCapacity()
public int bufferCapacity()
fun bufferCapacity(): Int
- (int)bufferCapacity
public func bufferCapacity() -> Int32
public virtual int bufferCapacity()

返回

类型 描述
Int32

setBufferCapacity

设置 InputFrame 缓冲的容量。

void easyar_InertialCameraDevice_setBufferCapacity(easyar_InertialCameraDevice * This, int capacity)
void setBufferCapacity(int capacity)
public void setBufferCapacity(int capacity)
fun setBufferCapacity(capacity: Int): Unit
- (void)setBufferCapacity:(int)capacity
public func setBufferCapacity(_ capacity: Int32) -> Void
public virtual void setBufferCapacity(int capacity)

参数

名称 类型 描述
capacity Int32

返回

类型 描述
Void

inputFrameSource

InputFrame 输出端口。

void easyar_InertialCameraDevice_inputFrameSource(easyar_InertialCameraDevice * This, easyar_InputFrameSource * * Return)
std::shared_ptr<InputFrameSource> inputFrameSource()
public @Nonnull InputFrameSource inputFrameSource()
fun inputFrameSource(): InputFrameSource
- (easyar_InputFrameSource *)inputFrameSource
public func inputFrameSource() -> InputFrameSource
public virtual InputFrameSource inputFrameSource()

返回

类型 描述
InputFrameSource

setFocusMode

设置对焦模式为focusMode。在start之前调用。

void easyar_InertialCameraDevice_setFocusMode(easyar_InertialCameraDevice * This, easyar_InertialCameraDeviceFocusMode focusMode)
void setFocusMode(InertialCameraDeviceFocusMode focusMode)
public void setFocusMode(int focusMode)
fun setFocusMode(focusMode: Int): Unit
- (void)setFocusMode:(easyar_InertialCameraDeviceFocusMode)focusMode
public func setFocusMode(_ focusMode: InertialCameraDeviceFocusMode) -> Void
public virtual void setFocusMode(InertialCameraDeviceFocusMode focusMode)

参数

名称 类型 描述
focusMode InertialCameraDeviceFocusMode

返回

类型 描述
Void

type

camera类型。在成功的open之后调用。

easyar_CameraDeviceType easyar_InertialCameraDevice_type(const easyar_InertialCameraDevice * This)
CameraDeviceType type()
public int type()
fun type(): Int
- (easyar_CameraDeviceType)type
public func type() -> CameraDeviceType
public virtual CameraDeviceType type()

返回

类型 描述
CameraDeviceType

cameraOrientation

camera图像在设备的自然方向上显示时需要顺时针旋转的角度。在成功的open之后调用。

int easyar_InertialCameraDevice_cameraOrientation(const easyar_InertialCameraDevice * This)
int cameraOrientation()
public int cameraOrientation()
fun cameraOrientation(): Int
- (int)cameraOrientation
public func cameraOrientation() -> Int32
public virtual int cameraOrientation()

返回

类型 描述
Int32

size

获取当前图像大小。在成功的open之后调用。

easyar_Vec2I easyar_InertialCameraDevice_size(const easyar_InertialCameraDevice * This)
Vec2I size()
public @Nonnull Vec2I size()
fun size(): Vec2I
- (easyar_Vec2I *)size
public func size() -> Vec2I
public virtual Vec2I size()

返回

类型 描述
Vec2I

supportedSizeCount

获取当前设备支持的所有图像大小的个数。在成功的open之后调用。

int easyar_InertialCameraDevice_supportedSizeCount(const easyar_InertialCameraDevice * This)
int supportedSizeCount()
public int supportedSizeCount()
fun supportedSizeCount(): Int
- (int)supportedSizeCount
public func supportedSizeCount() -> Int32
public virtual int supportedSizeCount()

返回

类型 描述
Int32

supportedSize

获取当前设备支持的所有图像大小的第 index 个. 如果 index 超出范围则返回{0, 0}。在成功的open之后调用。

easyar_Vec2I easyar_InertialCameraDevice_supportedSize(const easyar_InertialCameraDevice * This, int index)
Vec2I supportedSize(int index)
public @Nonnull Vec2I supportedSize(int index)
fun supportedSize(index: Int): Vec2I
- (easyar_Vec2I *)supportedSize:(int)index
public func supportedSize(_ index: Int32) -> Vec2I
public virtual Vec2I supportedSize(int index)

参数

名称 类型 描述
index Int32

返回

类型 描述
Vec2I

setSize

设置当前图像大小。最接近设置值的可选值将被使用。可以使用size来获取实际的大小。在成功的open之后调用。设置size后frameRateRange可能会发生变化。

bool easyar_InertialCameraDevice_setSize(easyar_InertialCameraDevice * This, easyar_Vec2I size)
bool setSize(Vec2I size)
public boolean setSize(@Nonnull Vec2I size)
fun setSize(size: Vec2I): Boolean
- (bool)setSize:(easyar_Vec2I *)size
public func setSize(_ size: Vec2I) -> Bool
public virtual bool setSize(Vec2I size)

参数

名称 类型 描述
size Vec2I

返回

类型 描述
Boolean

open

打开设备的后置camera,如果打开失败会返回false。

bool easyar_InertialCameraDevice_open(easyar_InertialCameraDevice * This)
bool open()
public boolean open()
fun open(): Boolean
- (bool)open
public func `open`() -> Bool
public virtual bool open()

返回

类型 描述
Boolean

start

开始采集视频流数据。

bool easyar_InertialCameraDevice_start(easyar_InertialCameraDevice * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()

返回

类型 描述
Boolean

stop

停止采集视频流数据。

void easyar_InertialCameraDevice_stop(easyar_InertialCameraDevice * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()

返回

类型 描述
Void

reset

重置状态。

void easyar_InertialCameraDevice_reset(easyar_InertialCameraDevice * This)
void reset()
public void reset()
fun reset(): Unit
- (void)reset
public func reset() -> Void
public virtual void reset()

返回

类型 描述
Void

close

关闭。close之后不应继续使用。

void easyar_InertialCameraDevice_close(easyar_InertialCameraDevice * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()

返回

类型 描述
Void

frameRateRangeLower

获取当前帧率范围下界。在成功的open之后调用。

double easyar_InertialCameraDevice_frameRateRangeLower(const easyar_InertialCameraDevice * This)
double frameRateRangeLower()
public double frameRateRangeLower()
fun frameRateRangeLower(): Double
- (double)frameRateRangeLower
public func frameRateRangeLower() -> Double
public virtual double frameRateRangeLower()

返回

类型 描述
Double

frameRateRangeUpper

获取当前帧率范围上界。在成功的open之后调用。

double easyar_InertialCameraDevice_frameRateRangeUpper(const easyar_InertialCameraDevice * This)
double frameRateRangeUpper()
public double frameRateRangeUpper()
fun frameRateRangeUpper(): Double
- (double)frameRateRangeUpper
public func frameRateRangeUpper() -> Double
public virtual double frameRateRangeUpper()

返回

类型 描述
Double