ThreeDofCameraDevice Class

Description

ThreeDofCameraDevice实现了一个three dof的camera设备,输出 InputFrame (包含图像、摄像机参数、时间戳、位姿转换矩阵和跟踪状态)。

创建之后,可以调用start/stop来开始和停止采集视频流数据。

当不再需要该设备时,可以调用close对其进行关闭。close之后不应继续使用。

ThreeDofCameraDevice通过inputFrameSource输出 InputFrame ,应将inputFrameSource连接到 InputFrameSink 上进行使用。参考 概览

bufferCapacity表示 InputFrame 缓冲的容量,如果有超过此数量的 InputFrame 从该设备中输出并且没有被释放,该设备将不再输出新的 InputFrame ,直到之前的 InputFrame 被释放。这可能造成画面卡住等问题。参考 概览

Constructor

默认创建方法,会得到一个 CameraTransformType 为ThreeDofRotOnly的 InputFrame

C

void easyar_ThreeDofCameraDevice__ctor(easyar_ThreeDofCameraDevice * * Return)

C++

ThreeDofCameraDevice()

Java

public ThreeDofCameraDevice()

Kotlin

constructor()

Objective-C

+ (easyar_ThreeDofCameraDevice *) create

Swift

public convenience init()

C#

public ThreeDofCameraDevice()

isAvailable

检查是否可用。只在Android或iOS上且陀螺仪可用时返回true。

C

bool easyar_ThreeDofCameraDevice_isAvailable(void)

C++

static bool isAvailable()

Java

public static boolean isAvailable()

Kotlin

companion object fun isAvailable(): Boolean

Objective-C

+ (bool)isAvailable

Swift

public static func isAvailable() -> Bool

C#

public static bool isAvailable()

bufferCapacity

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

C

int easyar_ThreeDofCameraDevice_bufferCapacity(const easyar_ThreeDofCameraDevice * This)

C++

int bufferCapacity()

Java

public int bufferCapacity()

Kotlin

fun bufferCapacity(): Int

Objective-C

- (int)bufferCapacity

Swift

public func bufferCapacity() -> Int32

C#

public virtual int bufferCapacity()

setBufferCapacity

设置 InputFrame 缓冲的容量。

C

void easyar_ThreeDofCameraDevice_setBufferCapacity(easyar_ThreeDofCameraDevice * This, int capacity)

C++

void setBufferCapacity(int capacity)

Java

public void setBufferCapacity(int capacity)

Kotlin

fun setBufferCapacity(capacity: Int): Unit

Objective-C

- (void)setBufferCapacity:(int)capacity

Swift

public func setBufferCapacity(_ capacity: Int32) -> Void

C#

public virtual void setBufferCapacity(int capacity)

inputFrameSource

InputFrame 输出端口。

C

void easyar_ThreeDofCameraDevice_inputFrameSource(easyar_ThreeDofCameraDevice * This, easyar_InputFrameSource * * Return)

C++

std::shared_ptr<InputFrameSource> inputFrameSource()

Java

public @Nonnull InputFrameSource inputFrameSource()

Kotlin

fun inputFrameSource(): InputFrameSource

Objective-C

- (easyar_InputFrameSource *)inputFrameSource

Swift

public func inputFrameSource() -> InputFrameSource

C#

public virtual InputFrameSource inputFrameSource()

setFocusMode

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

C

void easyar_ThreeDofCameraDevice_setFocusMode(easyar_ThreeDofCameraDevice * This, easyar_ThreeDofCameraDeviceFocusMode focusMode)

C++

void setFocusMode(ThreeDofCameraDeviceFocusMode focusMode)

Java

public void setFocusMode(int focusMode)

Kotlin

fun setFocusMode(focusMode: Int): Unit

Objective-C

- (void)setFocusMode:(easyar_ThreeDofCameraDeviceFocusMode)focusMode

Swift

public func setFocusMode(_ focusMode: ThreeDofCameraDeviceFocusMode) -> Void

C#

public virtual void setFocusMode(ThreeDofCameraDeviceFocusMode focusMode)

size

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

C

easyar_Vec2I easyar_ThreeDofCameraDevice_size(const easyar_ThreeDofCameraDevice * This)

C++

Vec2I size()

Java

public @Nonnull Vec2I size()

Kotlin

fun size(): Vec2I

Objective-C

- (easyar_Vec2I *)size

Swift

public func size() -> Vec2I

C#

public virtual Vec2I size()

supportedSizeCount

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

C

int easyar_ThreeDofCameraDevice_supportedSizeCount(const easyar_ThreeDofCameraDevice * This)

C++

int supportedSizeCount()

Java

public int supportedSizeCount()

Kotlin

fun supportedSizeCount(): Int

Objective-C

- (int)supportedSizeCount

Swift

public func supportedSizeCount() -> Int32

C#

public virtual int supportedSizeCount()

supportedSize

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

C

easyar_Vec2I easyar_ThreeDofCameraDevice_supportedSize(const easyar_ThreeDofCameraDevice * This, int index)

C++

Vec2I supportedSize(int index)

Java

public @Nonnull Vec2I supportedSize(int index)

Kotlin

fun supportedSize(index: Int): Vec2I

Objective-C

- (easyar_Vec2I *)supportedSize:(int)index

Swift

public func supportedSize(_ index: Int32) -> Vec2I

C#

public virtual Vec2I supportedSize(int index)

setSize

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

C

bool easyar_ThreeDofCameraDevice_setSize(easyar_ThreeDofCameraDevice * This, easyar_Vec2I size)

C++

bool setSize(Vec2I size)

Java

public boolean setSize(@Nonnull Vec2I size)

Kotlin

fun setSize(size: Vec2I): Boolean

Objective-C

- (bool)setSize:(easyar_Vec2I *)size

Swift

public func setSize(_ size: Vec2I) -> Bool

C#

public virtual bool setSize(Vec2I size)

open

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

C

bool easyar_ThreeDofCameraDevice_open(easyar_ThreeDofCameraDevice * This)

C++

bool open()

Java

public boolean open()

Kotlin

fun open(): Boolean

Objective-C

- (bool)open

Swift

public func `open`() -> Bool

C#

public virtual bool open()

start

开始采集视频流数据。

C

bool easyar_ThreeDofCameraDevice_start(easyar_ThreeDofCameraDevice * This)

C++

bool start()

Java

public boolean start()

Kotlin

fun start(): Boolean

Objective-C

- (bool)start

Swift

public func start() -> Bool

C#

public virtual bool start()

stop

停止采集视频流数据。

C

void easyar_ThreeDofCameraDevice_stop(easyar_ThreeDofCameraDevice * This)

C++

void stop()

Java

public void stop()

Kotlin

fun stop(): Unit

Objective-C

- (void)stop

Swift

public func stop() -> Void

C#

public virtual void stop()

close

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

C

void easyar_ThreeDofCameraDevice_close(easyar_ThreeDofCameraDevice * This)

C++

void close()

Java

public void close()

Kotlin

fun close(): Unit

Objective-C

- (void)close

Swift

public func close() -> Void

C#

public virtual void close()