VisionOSARKitCameraDevice Class¶
Description¶
VisionOSARKitCameraDevice实现了一个基于VisionOS ARKit的camera设备,输出 InputFrame (包含图像、摄像机参数、时间戳、6DOF位置信息和跟踪状态)。
创建之后,可以调用start/stop来开始和停止采集视频流数据。
当不再需要该设备时,可以调用close对其进行关闭。close之后不应继续使用。
VisionOSARKitCameraDevice通过inputFrameSource输出 InputFrame ,应将inputFrameSource连接到 InputFrameSink 上进行使用。参考 概览 。
bufferCapacity表示 InputFrame 缓冲的容量,如果有超过此数量的 InputFrame 从该设备中输出并且没有被释放,该设备将不再输出新的 InputFrame ,直到之前的 InputFrame 被释放。这可能造成画面卡住等问题。参考 概览 。
Constructor¶
- C
void easyar_VisionOSARKitCameraDevice__ctor(easyar_VisionOSARKitCameraDevice * * Return)
- C++
VisionOSARKitCameraDevice()
- Java
public VisionOSARKitCameraDevice()
- Kotlin
constructor()
- Objective-C
+ (easyar_VisionOSARKitCameraDevice *) create
- Swift
public convenience init()
- C#
public VisionOSARKitCameraDevice()
isAvailable¶
- C
bool easyar_VisionOSARKitCameraDevice_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_VisionOSARKitCameraDevice_bufferCapacity(const easyar_VisionOSARKitCameraDevice * 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_VisionOSARKitCameraDevice_setBufferCapacity(easyar_VisionOSARKitCameraDevice * 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)
requestPermissions¶
请求VisionOS上必要的系统权限, 包括[World Sensing]和[Camera Access]
- C
void easyar_VisionOSARKitCameraDevice_requestPermissions(easyar_VisionOSARKitCameraDevice * This, easyar_CallbackScheduler * callbackScheduler, easyar_OptionalOfFunctorOfVoidFromPermissionStatusAndString permissionCallback)
- C++
void requestPermissions(std::shared_ptr<CallbackScheduler> callbackScheduler, std::optional<std::function<void(PermissionStatus, std::string)>> permissionCallback)
- Java
public void requestPermissions(@Nonnull CallbackScheduler callbackScheduler, @Nullable FunctorOfVoidFromPermissionStatusAndString permissionCallback)
- Kotlin
fun requestPermissions(callbackScheduler: CallbackScheduler, permissionCallback: FunctorOfVoidFromPermissionStatusAndString?): Unit
- Objective-C
- (void)requestPermissions:(easyar_CallbackScheduler *)callbackScheduler permissionCallback:(void (^)(easyar_PermissionStatus status, NSString * value))permissionCallback
- Swift
public func requestPermissions(_ callbackScheduler: CallbackScheduler, _ permissionCallback: ((PermissionStatus, String) -> Void)?) -> Void
- C#
public virtual void requestPermissions(CallbackScheduler callbackScheduler, Optional<Action<PermissionStatus, string>> permissionCallback)
inputFrameSource¶
InputFrame 输出端口。
- C
void easyar_VisionOSARKitCameraDevice_inputFrameSource(easyar_VisionOSARKitCameraDevice * 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()
getMotionInputData¶
获取同步的运动输入数据。
- C
void easyar_VisionOSARKitCameraDevice_getMotionInputData(easyar_VisionOSARKitCameraDevice * This, easyar_OptionalOfMotionInputData * Return)
- C++
std::optional<std::shared_ptr<MotionInputData>> getMotionInputData()
- Java
public @Nullable MotionInputData getMotionInputData()
- Kotlin
fun getMotionInputData(): MotionInputData?
- Objective-C
- (easyar_MotionInputData *)getMotionInputData
- Swift
public func getMotionInputData() -> MotionInputData?
- C#
public virtual Optional<MotionInputData> getMotionInputData()
start¶
开始采集视频流数据。
- C
bool easyar_VisionOSARKitCameraDevice_start(easyar_VisionOSARKitCameraDevice * 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_VisionOSARKitCameraDevice_stop(easyar_VisionOSARKitCameraDevice * 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_VisionOSARKitCameraDevice_close(easyar_VisionOSARKitCameraDevice * 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()
size¶
获取当前图像大小。
type¶
camera类型。
- C
easyar_CameraDeviceType easyar_VisionOSARKitCameraDevice_type(const easyar_VisionOSARKitCameraDevice * This)
- C++
CameraDeviceType type()
- Java
public int type()
- Kotlin
fun type(): Int
- Objective-C
- (easyar_CameraDeviceType)type
- Swift
public func type() -> CameraDeviceType
- C#
public virtual CameraDeviceType type()
cameraOrientation¶
camera图像在设备的自然方向上显示时需要顺时针旋转的角度。
- C
int easyar_VisionOSARKitCameraDevice_cameraOrientation(const easyar_VisionOSARKitCameraDevice * This)
- C++
int cameraOrientation()
- Java
public int cameraOrientation()
- Kotlin
fun cameraOrientation(): Int
- Objective-C
- (int)cameraOrientation
- Swift
public func cameraOrientation() -> Int32
- C#
public virtual int cameraOrientation()
frameRateRangeLower¶
获取当前帧率范围下界。
- C
double easyar_VisionOSARKitCameraDevice_frameRateRangeLower(const easyar_VisionOSARKitCameraDevice * This)
- C++
double frameRateRangeLower()
- Java
public double frameRateRangeLower()
- Kotlin
fun frameRateRangeLower(): Double
- Objective-C
- (double)frameRateRangeLower
- Swift
public func frameRateRangeLower() -> Double
- C#
public virtual double frameRateRangeLower()
frameRateRangeUpper¶
获取当前帧率范围上界。
- C
double easyar_VisionOSARKitCameraDevice_frameRateRangeUpper(const easyar_VisionOSARKitCameraDevice * This)
- C++
double frameRateRangeUpper()
- Java
public double frameRateRangeUpper()
- Kotlin
fun frameRateRangeUpper(): Double
- Objective-C
- (double)frameRateRangeUpper
- Swift
public func frameRateRangeUpper() -> Double
- C#
public virtual double frameRateRangeUpper()