Class ThreeDofCameraDevice
- 命名空间
- easyar
ThreeDofCameraDevice实现了一个three dof的camera设备,输出 CameraTransformType 为ThreeDofRotOnly的 InputFrame (包含图像、摄像机参数、时间戳、位姿转换矩阵和跟踪状态)。 创建之后,可以调用start/stop来开始和停止采集视频流数据。 当不再需要该设备时,可以调用close对其进行关闭。close之后不应继续使用。 ThreeDofCameraDevice通过inputFrameSource输出 InputFrame ,应将inputFrameSource连接到 InputFrameSink 上进行使用。 bufferCapacity表示 InputFrame 缓冲的容量,如果有超过此数量的 InputFrame 从该设备中输出并且没有被释放,该设备将不再输出新的 InputFrame ,直到之前的 InputFrame 被释放。这可能造成画面卡住等问题。
构造函数
ThreeDofCameraDevice
默认创建方法。
void easyar_ThreeDofCameraDevice__ctor(easyar_ThreeDofCameraDevice * * Return)
ThreeDofCameraDevice()
public ThreeDofCameraDevice()
constructor()
+ (easyar_ThreeDofCameraDevice *) create
public convenience init()
public ThreeDofCameraDevice()
方法
isAvailable
检查是否可用。只在Android或iOS上且陀螺仪可用时返回true。
bool easyar_ThreeDofCameraDevice_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_ThreeDofCameraDevice_bufferCapacity(const easyar_ThreeDofCameraDevice * This)
int bufferCapacity()
public int bufferCapacity()
fun bufferCapacity(): Int
- (int)bufferCapacity
public func bufferCapacity() -> Int32
public virtual int bufferCapacity()
返回
| 类型 | 描述 |
|---|---|
| Int32 |
setBufferCapacity
设置 InputFrame 缓冲的容量。
void easyar_ThreeDofCameraDevice_setBufferCapacity(easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_inputFrameSource(easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_setFocusMode(easyar_ThreeDofCameraDevice * This, easyar_ThreeDofCameraDeviceFocusMode focusMode)
void setFocusMode(ThreeDofCameraDeviceFocusMode focusMode)
public void setFocusMode(int focusMode)
fun setFocusMode(focusMode: Int): Unit
- (void)setFocusMode:(easyar_ThreeDofCameraDeviceFocusMode)focusMode
public func setFocusMode(_ focusMode: ThreeDofCameraDeviceFocusMode) -> Void
public virtual void setFocusMode(ThreeDofCameraDeviceFocusMode focusMode)
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| focusMode | ThreeDofCameraDeviceFocusMode |
返回
| 类型 | 描述 |
|---|---|
| Void |
type
camera类型。在成功的open之后调用。
easyar_CameraDeviceType easyar_ThreeDofCameraDevice_type(const easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_cameraOrientation(const easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_size(const easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_supportedSizeCount(const easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_supportedSize(const easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_setSize(easyar_ThreeDofCameraDevice * 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_ThreeDofCameraDevice_open(easyar_ThreeDofCameraDevice * This)
bool open()
public boolean open()
fun open(): Boolean
- (bool)open
public func `open`() -> Bool
public virtual bool open()
返回
| 类型 | 描述 |
|---|---|
| Boolean |
start
开始采集视频流数据。
bool easyar_ThreeDofCameraDevice_start(easyar_ThreeDofCameraDevice * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()
返回
| 类型 | 描述 |
|---|---|
| Boolean |
stop
停止采集视频流数据。
void easyar_ThreeDofCameraDevice_stop(easyar_ThreeDofCameraDevice * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()
返回
| 类型 | 描述 |
|---|---|
| Void |
close
关闭。close之后不应继续使用。
void easyar_ThreeDofCameraDevice_close(easyar_ThreeDofCameraDevice * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()
返回
| 类型 | 描述 |
|---|---|
| Void |
frameRateRangeLower
获取当前帧率范围下界。在成功的open之后调用。
double easyar_ThreeDofCameraDevice_frameRateRangeLower(const easyar_ThreeDofCameraDevice * This)
double frameRateRangeLower()
public double frameRateRangeLower()
fun frameRateRangeLower(): Double
- (double)frameRateRangeLower
public func frameRateRangeLower() -> Double
public virtual double frameRateRangeLower()
返回
| 类型 | 描述 |
|---|---|
| Double |
frameRateRangeUpper
获取当前帧率范围上界。在成功的open之后调用。
double easyar_ThreeDofCameraDevice_frameRateRangeUpper(const easyar_ThreeDofCameraDevice * This)
double frameRateRangeUpper()
public double frameRateRangeUpper()
fun frameRateRangeUpper(): Double
- (double)frameRateRangeUpper
public func frameRateRangeUpper() -> Double
public virtual double frameRateRangeUpper()
返回
| 类型 | 描述 |
|---|---|
| Double |