ThreeDofCameraDevice Class¶
This type is an EasyAR Sense API in C#: ThreeDofCameraDevice . Some descriptions may not apply to Unity environment on this page.
This type is partially wrapped into Unity components: ThreeDofCameraDeviceFrameSource . Members and instances of this type are not required to be used directly in most situations. Use this type by ThreeDofCameraDeviceFrameSource.Device instead of creating new instances when a few unwrapped API is desired for use.
Description¶
ThreeDofCameraDevice implements a three dof camera device, which outputs InputFrame (including image, camera parameters, timestamp, camera transform matrix and tracking status).
After creation, start/stop can be invoked to start or stop video stream capture.
When the component is not needed anymore, call close function to close it. It shall not be used after calling close.
ThreeDofCameraDevice outputs InputFrame from inputFrameSource. inputFrameSource shall be connected to InputFrameSink for use. Refer to Overview .
bufferCapacity is the capacity of InputFrame buffer. If the count of InputFrame which has been output from the device and have not been released is more than this number, the device will not output new InputFrame , until previous InputFrame have been released. This may cause screen stuck. Refer to Overview .
Methods¶
.ctor¶
- C#
public ThreeDofCameraDevice()
Default create method, will outputs InputFrame which CameraTransformType is ThreeDofRotOnly.
isAvailable¶
- C#
public static bool isAvailable()
Checks if the component is available. It returns true only on Android or IOS when the gyroscope is available.
bufferCapacity¶
- C#
public virtual int bufferCapacity()
InputFrame buffer capacity. The default is 8.
setBufferCapacity¶
- C#
public virtual void setBufferCapacity(int capacity)
Sets InputFrame buffer capacity.
inputFrameSource¶
- C#
public virtual InputFrameSource inputFrameSource()
InputFrame output port.
setFocusMode¶
- C#
public virtual void setFocusMode( ThreeDofCameraDeviceFocusMode focusMode)
Sets focus mode to focusMode. Call before start.
type¶
- C#
public virtual CameraDeviceType type()
Camera type. Call after a successful open.
cameraOrientation¶
- C#
public virtual int cameraOrientation()
Angles rotation required to rotate clockwise and display camera image on device with natural orientation. Call after a successful open.
size¶
- C#
public virtual Vec2I size()
Gets the current preview size. Call after a successful open.
supportedSizeCount¶
- C#
public virtual int supportedSizeCount()
Gets the number of supported preview sizes. Call after a successful open.
supportedSize¶
- C#
public virtual Vec2I supportedSize(int index)
Gets the index-th supported preview size. It returns {0, 0} if index is out of range. Call after a successful open.
setSize¶
- C#
public virtual bool setSize( Vec2I size)
Sets the preview size. The available nearest value will be selected. Call size to get the actual size. Call after a successful open. frameRateRange may change after calling setSize.
open¶
- C#
public virtual bool open()
Opens back camera of device. If the opening fails will return false.
start¶
- C#
public virtual bool start()
Starts video stream capture.
stop¶
- C#
public virtual void stop()
Stops video stream capture.
close¶
- C#
public virtual void close()
Close. The component shall not be used after calling close.
frameRateRangeLower¶
- C#
public virtual double frameRateRangeLower()
Gets lower bound of current frame rate range. Call after a successful open.
frameRateRangeUpper¶
- C#
public virtual double frameRateRangeUpper()
Gets upper bound of current frame rate range. Call after a successful open.