Table of Contents

Class ARKitCameraDevice

Namespace
easyar

ARKitCameraDevice implements an ARKit-based camera device, outputting InputFrame (including image, camera parameters, timestamp, 6DOF position information, and tracking state). After creation, you can call start/stop to start and stop collecting video stream data. When the device is no longer needed, you can call close to close it. It should not be used further after close. ARKitCameraDevice outputs InputFrame through inputFrameSource, and inputFrameSource should be connected to InputFrameSink for use. bufferCapacity indicates the capacity of InputFrame buffer. If there are more InputFrame output from this device than this number and not released, the device will no longer output new InputFrame until the previous InputFrame is released. This may cause problems such as screen freezing.

ARKitCameraDevice

Constructors

ARKitCameraDevice

void easyar_ARKitCameraDevice__ctor(easyar_ARKitCameraDevice * * Return)
ARKitCameraDevice()
public ARKitCameraDevice()
constructor()
+ (easyar_ARKitCameraDevice *) create
public convenience init()
public ARKitCameraDevice()

Methods

isAvailable

Check if available. Returns true only on iOS 11 or later systems and on ARKit-supported hardware.

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()

Returns

Boolean

bufferCapacity

The capacity of InputFrame buffer, default is 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()

Returns

Int32

setBufferCapacity

Set the capacity of InputFrame buffer.

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)

Parameters

capacity Int32

Returns

Void

inputFrameSource

InputFrame output port.

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()

Returns

InputFrameSource

setFocusMode

Set focus mode to focusMode. Call before start. Effective on iOS 11.3 and later.

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)

Parameters

focusMode ARKitCameraDeviceFocusMode

Returns

Void

start

Start collecting video stream data.

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()

Returns

Boolean

stop

Stop collecting video stream data.

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()

Returns

Void

close

Close. Should not be used further after 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()

Returns

Void

type

camera type.

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()

Returns

CameraDeviceType

cameraOrientation

The angle by which the camera image needs to be rotated clockwise when displayed in the natural orientation of the device.

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()

Returns

Int32

size

Get current image 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()

Returns

Vec2I

frameRate

Get current frame rate.

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()

Returns

Double

supportedSizeCount

Get the number of all image sizes supported by the current device.

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()

Returns

Int32

supportedSize

Get the index-th image size supported by the current device. If index is out of range, return {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)

Parameters

index Int32

Returns

Vec2I

setSize

Set current image size. The closest optional value to the set value will be used. The actual size can be obtained using size. After setting size, frameRateRange may change.

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)

Parameters

size Vec2I

Returns

Boolean

supportedFrameRateCount

Get the number of frame rates supported by the current device.

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()

Returns

Int32

supportedFrameRate

Get the index-th frame rate supported by the current device.

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)

Parameters

index Int32

Returns

Double

setFrameRate

Set the current frame rate of the current device.

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)

Parameters

frameRate Double

Returns

Boolean