Class ARKitCameraDevice
- 命名空间
- easyar
ARKitCameraDevice实现了一个基于ARKit的camera设备,输出 InputFrame (包含图像、摄像机参数、时间戳、6DOF位置信息和跟踪状态)。 创建之后,可以调用start/stop来开始和停止采集视频流数据。 当不再需要该设备时,可以调用close对其进行关闭。close之后不应继续使用。 ARKitCameraDevice通过inputFrameSource输出 InputFrame ,应将inputFrameSource连接到 InputFrameSink 上进行使用。 bufferCapacity表示 InputFrame 缓冲的容量,如果有超过此数量的 InputFrame 从该设备中输出并且没有被释放,该设备将不再输出新的 InputFrame ,直到之前的 InputFrame 被释放。这可能造成画面卡住等问题。
构造函数
ARKitCameraDevice
void easyar_ARKitCameraDevice__ctor(easyar_ARKitCameraDevice * * Return)
ARKitCameraDevice()
public ARKitCameraDevice()
constructor()
+ (easyar_ARKitCameraDevice *) create
public convenience init()
public ARKitCameraDevice()
方法
isAvailable
检查是否可用。只在iOS 11或更高版本的系统上且在支持ARKit的硬件上时返回true。
bool easyar_ARKitCameraDevice_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_ARKitCameraDevice_bufferCapacity(const easyar_ARKitCameraDevice * This)
int bufferCapacity()
public int bufferCapacity()
fun bufferCapacity(): Int
- (int)bufferCapacity
public func bufferCapacity() -> Int32
public virtual int bufferCapacity()
返回
| 类型 | 描述 |
|---|---|
| Int32 |
setBufferCapacity
设置 InputFrame 缓冲的容量。
void easyar_ARKitCameraDevice_setBufferCapacity(easyar_ARKitCameraDevice * 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_ARKitCameraDevice_inputFrameSource(easyar_ARKitCameraDevice * 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之前调用。iOS 11.3及之后有效。
void easyar_ARKitCameraDevice_setFocusMode(easyar_ARKitCameraDevice * This, easyar_ARKitCameraDeviceFocusMode focusMode)
void setFocusMode(ARKitCameraDeviceFocusMode focusMode)
public void setFocusMode(int focusMode)
fun setFocusMode(focusMode: Int): Unit
- (void)setFocusMode:(easyar_ARKitCameraDeviceFocusMode)focusMode
public func setFocusMode(_ focusMode: ARKitCameraDeviceFocusMode) -> Void
public virtual void setFocusMode(ARKitCameraDeviceFocusMode focusMode)
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| focusMode | ARKitCameraDeviceFocusMode |
返回
| 类型 | 描述 |
|---|---|
| Void |
start
开始采集视频流数据。
bool easyar_ARKitCameraDevice_start(easyar_ARKitCameraDevice * This)
bool start()
public boolean start()
fun start(): Boolean
- (bool)start
public func start() -> Bool
public virtual bool start()
返回
| 类型 | 描述 |
|---|---|
| Boolean |
stop
停止采集视频流数据。
void easyar_ARKitCameraDevice_stop(easyar_ARKitCameraDevice * This)
void stop()
public void stop()
fun stop(): Unit
- (void)stop
public func stop() -> Void
public virtual void stop()
返回
| 类型 | 描述 |
|---|---|
| Void |
close
关闭。close之后不应继续使用。
void easyar_ARKitCameraDevice_close(easyar_ARKitCameraDevice * This)
void close()
public void close()
fun close(): Unit
- (void)close
public func close() -> Void
public virtual void close()
返回
| 类型 | 描述 |
|---|---|
| Void |
type
camera类型。
easyar_CameraDeviceType easyar_ARKitCameraDevice_type(const easyar_ARKitCameraDevice * This)
CameraDeviceType type()
public int type()
fun type(): Int
- (easyar_CameraDeviceType)type
public func type() -> CameraDeviceType
public virtual CameraDeviceType type()
返回
| 类型 | 描述 |
|---|---|
| CameraDeviceType |
cameraOrientation
camera图像在设备的自然方向上显示时需要顺时针旋转的角度。
int easyar_ARKitCameraDevice_cameraOrientation(const easyar_ARKitCameraDevice * This)
int cameraOrientation()
public int cameraOrientation()
fun cameraOrientation(): Int
- (int)cameraOrientation
public func cameraOrientation() -> Int32
public virtual int cameraOrientation()
返回
| 类型 | 描述 |
|---|---|
| Int32 |
size
获取当前图像大小。
easyar_Vec2I easyar_ARKitCameraDevice_size(const easyar_ARKitCameraDevice * This)
Vec2I size()
public @Nonnull Vec2I size()
fun size(): Vec2I
- (easyar_Vec2I *)size
public func size() -> Vec2I
public virtual Vec2I size()
返回
| 类型 | 描述 |
|---|---|
| Vec2I |
frameRate
获取当前帧率。
double easyar_ARKitCameraDevice_frameRate(const easyar_ARKitCameraDevice * This)
double frameRate()
public double frameRate()
fun frameRate(): Double
- (double)frameRate
public func frameRate() -> Double
public virtual double frameRate()
返回
| 类型 | 描述 |
|---|---|
| Double |
supportedSizeCount
获取当前设备支持的所有图像大小的个数。
int easyar_ARKitCameraDevice_supportedSizeCount(const easyar_ARKitCameraDevice * 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}。
easyar_Vec2I easyar_ARKitCameraDevice_supportedSize(const easyar_ARKitCameraDevice * 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来获取实际的大小。设置size后frameRateRange可能会发生变化。
bool easyar_ARKitCameraDevice_setSize(easyar_ARKitCameraDevice * 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 |
supportedFrameRateCount
获取当前设备支持的帧率的个数。
int easyar_ARKitCameraDevice_supportedFrameRateCount(const easyar_ARKitCameraDevice * This)
int supportedFrameRateCount()
public int supportedFrameRateCount()
fun supportedFrameRateCount(): Int
- (int)supportedFrameRateCount
public func supportedFrameRateCount() -> Int32
public virtual int supportedFrameRateCount()
返回
| 类型 | 描述 |
|---|---|
| Int32 |
supportedFrameRate
获取当前设备支持的第 index 个帧率。
double easyar_ARKitCameraDevice_supportedFrameRate(const easyar_ARKitCameraDevice * This, int index)
double supportedFrameRate(int index)
public double supportedFrameRate(int index)
fun supportedFrameRate(index: Int): Double
- (double)supportedFrameRate:(int)index
public func supportedFrameRate(_ index: Int32) -> Double
public virtual double supportedFrameRate(int index)
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| index | Int32 |
返回
| 类型 | 描述 |
|---|---|
| Double |
setFrameRate
设置当前设备的当前帧率。
bool easyar_ARKitCameraDevice_setFrameRate(easyar_ARKitCameraDevice * This, double frameRate)
bool setFrameRate(double frameRate)
public boolean setFrameRate(double frameRate)
fun setFrameRate(frameRate: Double): Boolean
- (bool)setFrameRate:(double)frameRate
public func setFrameRate(_ frameRate: Double) -> Bool
public virtual bool setFrameRate(double frameRate)
参数
| 名称 | 类型 | 描述 |
|---|---|---|
| frameRate | Double |
返回
| 类型 | 描述 |
|---|---|
| Boolean |