Class InertialCameraDevice
InertialCameraDevice implements a camera device based on motion inertia, outputting CameraTransformType as FiveDofRotXZ InputFrame (including images, camera parameters, timestamp, pose transformation matrix, and tracking status).
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 shut it down. After close, it should not be used anymore.
InertialCameraDevice outputs InputFrame through inputFrameSource, and inputFrameSource should be connected to InputFrameSink for use.
bufferCapacity represents the buffer capacity of InputFrame. If more than this number of InputFrame are output from the device and not released, the device will stop outputting new InputFrame until the previous ones are released. This may cause issues like screen freezing.
InertialCameraDevice
Constructors
InertialCameraDevice
void easyar_InertialCameraDevice__ctor(easyar_InertialCameraDevice * * Return)
public InertialCameraDevice()
+ (easyar_InertialCameraDevice *) create
public convenience init()
public InertialCameraDevice()
Methods
isAvailable
Checks if available. Returns true only on Android 7.0 and above (API Level 24+) and when accelerometer, gyroscope, and attitude sensor are available.
bool easyar_InertialCameraDevice_isAvailable(void)
static bool isAvailable()
public static boolean isAvailable()
companion object fun isAvailable(): Boolean
public static func isAvailable() -> Bool
public static bool isAvailable()
Returns
bufferCapacity
Buffer capacity of InputFrame, default value is 8.
int easyar_InertialCameraDevice_bufferCapacity(const easyar_InertialCameraDevice * This)
public int bufferCapacity()
fun bufferCapacity(): Int
public func bufferCapacity() -> Int32
public virtual int bufferCapacity()
Returns
setBufferCapacity
void easyar_InertialCameraDevice_setBufferCapacity(easyar_InertialCameraDevice * 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
| Name |
Type |
Description |
| capacity |
Int32 |
|
Returns
void easyar_InertialCameraDevice_inputFrameSource(easyar_InertialCameraDevice * 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
setFocusMode
Sets the focus mode to focusMode. Called before start.
void easyar_InertialCameraDevice_setFocusMode(easyar_InertialCameraDevice * This, easyar_InertialCameraDeviceFocusMode focusMode)
void setFocusMode(InertialCameraDeviceFocusMode focusMode)
public void setFocusMode(int focusMode)
fun setFocusMode(focusMode: Int): Unit
- (void)setFocusMode:(easyar_InertialCameraDeviceFocusMode)focusMode
public func setFocusMode(_ focusMode: InertialCameraDeviceFocusMode) -> Void
public virtual void setFocusMode(InertialCameraDeviceFocusMode focusMode)
Parameters
Returns
type
Camera type. Called after successful open.
easyar_CameraDeviceType easyar_InertialCameraDevice_type(const easyar_InertialCameraDevice * This)
- (easyar_CameraDeviceType)type
public func type() -> CameraDeviceType
public virtual CameraDeviceType type()
Returns
cameraOrientation
The angle that the camera image needs to be rotated clockwise to display in the device's natural orientation. Called after successful open.
int easyar_InertialCameraDevice_cameraOrientation(const easyar_InertialCameraDevice * This)
public int cameraOrientation()
fun cameraOrientation(): Int
public func cameraOrientation() -> Int32
public virtual int cameraOrientation()
Returns
size
Gets the current image size. Called after successful open.
easyar_Vec2I easyar_InertialCameraDevice_size(const easyar_InertialCameraDevice * This)
public @Nonnull Vec2I size()
public func size() -> Vec2I
public virtual Vec2I size()
Returns
supportedSizeCount
Gets the number of all image sizes supported by the current device. Called after successful open.
int easyar_InertialCameraDevice_supportedSizeCount(const easyar_InertialCameraDevice * This)
public int supportedSizeCount()
fun supportedSizeCount(): Int
- (int)supportedSizeCount
public func supportedSizeCount() -> Int32
public virtual int supportedSizeCount()
Returns
supportedSize
Gets the index-th image size supported by the current device. If index is out of range, returns {0, 0}. Called after successful open.
easyar_Vec2I easyar_InertialCameraDevice_supportedSize(const easyar_InertialCameraDevice * 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
| Name |
Type |
Description |
| index |
Int32 |
|
Returns
setSize
Sets the current image size. The closest available value to the set value will be used. You can use size to get the actual size. Called after successful open. Setting the size may change the frameRateRange.
bool easyar_InertialCameraDevice_setSize(easyar_InertialCameraDevice * This, easyar_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
| Name |
Type |
Description |
| size |
Vec2I |
|
Returns
open
Opens the rear camera of the device. Returns false if opening fails.
bool easyar_InertialCameraDevice_open(easyar_InertialCameraDevice * This)
public func `open`() -> Bool
public virtual bool open()
Returns
start
Starts collecting video stream data.
bool easyar_InertialCameraDevice_start(easyar_InertialCameraDevice * This)
public func start() -> Bool
public virtual bool start()
Returns
stop
Stops collecting video stream data.
void easyar_InertialCameraDevice_stop(easyar_InertialCameraDevice * This)
public func stop() -> Void
public virtual void stop()
Returns
reset
void easyar_InertialCameraDevice_reset(easyar_InertialCameraDevice * This)
public func reset() -> Void
public virtual void reset()
Returns
close
Closes. After close, it should not be used anymore.
void easyar_InertialCameraDevice_close(easyar_InertialCameraDevice * This)
public func close() -> Void
public virtual void close()
Returns
frameRateRangeLower
Gets the lower bound of the current frame rate range. Called after successful open.
double easyar_InertialCameraDevice_frameRateRangeLower(const easyar_InertialCameraDevice * This)
double frameRateRangeLower()
public double frameRateRangeLower()
fun frameRateRangeLower(): Double
- (double)frameRateRangeLower
public func frameRateRangeLower() -> Double
public virtual double frameRateRangeLower()
Returns
frameRateRangeUpper
Gets the upper bound of the current frame rate range. Called after successful open.
double easyar_InertialCameraDevice_frameRateRangeUpper(const easyar_InertialCameraDevice * This)
double frameRateRangeUpper()
public double frameRateRangeUpper()
fun frameRateRangeUpper(): Double
- (double)frameRateRangeUpper
public func frameRateRangeUpper() -> Double
public virtual double frameRateRangeUpper()
Returns