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

int 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 – Specify the connection method. This parameter can be one of the following values:

    • CSI

    • USB

  • path – Device node, the default value is video0.

Returns

Return Status code, The returned value can be: OK or ERROR(0 or -1).

int close()

close the camera

Returns

Return Status code, The returned value can be: OK or ERROR(0 or -1).

int 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

Return Status code, The returned value can be: OK or ERROR(0 or -1).

int stop()

Stop camera stream and processing.

Returns

Return Status code, The returned value can be: OK or ERROR(0 or -1).

int setOutputType(FrameType type)

Specifies the frame Output Type.

Note

Please call the function operation to reset the frame output format before starting the camera

Parameters

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

  • RAW_FRAME

  • DEPTH_FRAME

Returns

Return Status code, The returned value can be: OK or ERROR(0 or -1).

int setControl(ControlID mode, int value)

Set camera parameters.

Returns

Return Status code, The returned value can be: OK or ERROR(0 or -1).

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 means to wait all the time, 0 means immediate range, other values indicate the maximum waiting time, the unit is milliseconds.

Returns

ArducamTOFFrame class address.

int releaseFrame(ArducamFrameBuffer *frame)

Free the memory space of the frame.

Returns

Return Status code, The returned value can be: OK or ERROR(0 or -1).

TOFFrame

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 – Specify the frame data type. This parameter can be one of the following values:

  • RAW_FRAME

  • AMPLITUDE_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* : AMPLITUDE_FRAME

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

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

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

    • RAW_FRAME

    • AMPLITUDE_FRAME

    • DEPTH_FRAME

  • format – Returns the frame data format of the specified frame type

Returns

Return Status code, The returned value can be: OK or ERROR(0 or -1).