C++ API References

TOFCamera

namespace Arducam
class ArducamTOFCamera
#include <ArducamTOFCamera.hpp>

Camera application layer class, used to manage the camera and process frame data.

Public Functions

TofErrorCode open(Connection mode, const int index = 0)

Initialize the camera configuration and turn on the camera, set the initialization frame according to the mode

Parameters:
  • mode[in] Specify the connection method.

  • index[in] Device node, the default value is video0.

Returns:

An ErrorCode.

TofErrorCode openWithFile(const char *path, const int index = 0)

Initialize the camera configuration and turn on the camera, set the initialization frame according to the path

Parameters:
  • path[in] Specify the camera configuration file path.

  • index[in] Device node, the default value is video0.

Returns:

An ErrorCode.

TofErrorCode close()

close the camera

Returns:

An ErrorCode.

TofErrorCode start(FrameType type = FrameType::DEPTH_FRAME)

Start the camera stream and start processing.

Parameters:

type – Specify the camera output format. This parameter can be one of the following values:

  • RAW_FRAME

  • DEPTH_FRAME

Returns:

An ErrorCode.

TofErrorCode stop()

Stop camera stream and processing.

Returns:

An ErrorCode.

TofErrorCode setControl(CameraCtrl mode, int value)

Set camera parameters.

Returns:

An ErrorCode.

TofErrorCode setControlExt(CameraCtrl mode, const char *value)

Set camera parameters.

Returns:

An ErrorCode.

TofErrorCode getControl(CameraCtrl mode, int *value)

Get camera parameters.

Returns:

An ErrorCode.

TofErrorCode getControlExt(CameraCtrl mode, const char **value)

Get camera parameters.

Returns:

An ErrorCode.

CameraInfo getCameraInfo() const

Get the Camera frames format.

Returns:

All frame data formats contained in frame, The returned value include: width, height and Frametype

ArducamFrameBuffer *requestFrame(int16_t timeout)

Request a frame of data from the frame processing thread.

Parameters:

timeout – Timeout time, -1 if wait indefinitely, 0 if immediate, other values indicate the maximum waiting time, in milliseconds.

Returns:

ArducamTOFFrame class address.

TofErrorCode releaseFrame(ArducamFrameBuffer *frame)

Free the memory space of the frame.

Parameters:

frame – The address of the frame to be released

Returns:

An ErrorCode.

FrameBuffer

namespace Arducam
class ArducamFrameBuffer
#include <ArducamTOFData.hpp>

AbstractData.

Subclassed by Arducam::CacheData, Arducam::DepthData, Arducam::RawData

Public Functions

virtual void *getData(FrameType type) = 0

Get the Pointer of Frame Data.

Parameters:

type[in] Specify the frame data type. This parameter can be one of the following values:

  • RAW_FRAME

  • CONFIDENCE_FRAME

  • DEPTH_FRAME

Returns:

Return Pointer of Frame Data.The returned pointer type can be one of the following type:

  • int16_t* : RAW_FRAME

  • float* : DEPTH_FRAME

  • float* : CONFIDENCE_FRAME

virtual TofErrorCode getFrameDataFormat(FrameType type, FrameDataFormat &format) = 0

Specify the frame data type to get the frame data format.

Parameters:
  • type[in] Specify the frame data type. This parameter can be one of the following values:

    • RAW_FRAME

    • CONFIDENCE_FRAME

    • DEPTH_FRAME

  • format[out] Returns the frame data format of the specified frame type

Returns:

An ErrorCode.