Time-of-Flight Library(ToF) 3.11.1
 
chronoptics::tof::Camera Class Reference

The main interface to the depth cameras. More...

#include <camera.hpp>

+ Inheritance diagram for chronoptics::tof::Camera:

Public Member Functions

 Camera (tof_camera_t ptr=nullptr)
 Construct from pointer.
 
void start ()
 Start streaming of the camera.
 
void stop ()
 Stop streaming of the camera.
 
bool is_streaming () const
 Check whether the camera is streaming.
 
bool is_connected () const
 Check whether the camera is still connected.
 
std::vector< Streamget_stream_list () const
 Get the different output streams the camera can provide.
 
void set_stream_list (const std::vector< Stream > &streams)
 Set the streams that you want to get from the camera.
 
bool is_stream_list_set () const
 Check whether the stream list is set.
 
std::vector< Streamget_set_stream_list ()
 Get the stream list that is set on the camera.
 
ProcessingConfig get_process_config () const
 Get the processing config of the camera.
 
void set_process_config (ProcessingConfig &config)
 Set the processing config of the camera.
 
bool has_frames () const
 Check if the camera has frames available.
 
std::vector< Dataget_frames ()
 Get data frames from camera.
 
void clear_buffer ()
 Clear the circular buffer used to store frames.
 
size_t get_buffer_size () const
 Get the circular buffer size.
 
void set_buffer_size (size_t size)
 Set the circular buffer size.
 
CameraConfig get_camera_config () const
 Get the currently active camera config.
 
const char * get_serial () const
 Get the serial number of the current camera.
 
Calibration get_calibration () const
 Get calibration from the camera.
 
size_t get_user_pointer_capacity () const
 Get the amount of user pointers that can be stored.
 
void set_user_pointer_capacity (size_t capacity)
 Set the amount of user pointers that can be stored.
 
void add_user_pointer (uint8_t *pointer, size_t capacity, user_pointer_destructed_fn &callback, FrameType frame_type)
 Add a pointer that will be filled with the specified data type.
 
void add_user_pointer (uint8_t *pointer, size_t capacity, tof_user_pointer_destructed_t callback, void *callback_user_data, FrameType frame_type)
 Add a pointer that will be filled with the specified data type.
 
void clear_user_pointers ()
 Clear all user pointers in memory.
 
uint32_t config_index () const
 Get the currently set configuration index.
 
void switch_config (uint32_t config_index)
 Switch to a different config in real time, depending on configuration and camera, this can take 100-300ms.
 
std::vector< FrameType > possible_frame_types () const
 Get the frame types that this camera can output.
 
std::vector< FrameType > get_output_frame_types () const
 Get the frame types the camera should output.
 
void set_output_frame_types (const std::vector< FrameType > &output_frame_types)
 Set the frame types the camera should output.
 
bool has_multiple_configurations () const
 Check if multiple configurations are set.
 
std::vector< CameraConfigget_multiple_camera_configurations () const
 Get all the set camera configurations.
 
std::vector< ProcessingConfigget_multiple_processing_configurations () const
 Get all the set processing configurations.
 
std::vector< const char * > get_multiple_names () const
 Get the name for each configuration.
 
std::vector< const char * > get_multiple_descriptions () const
 Get the description for each configuration.
 

Detailed Description

The main interface to the depth cameras.

Definition at line 17 of file camera.hpp.

Constructor & Destructor Documentation

◆ Camera()

chronoptics::tof::Camera::Camera ( tof_camera_t  ptr = nullptr)
inline

Construct from pointer.

Definition at line 20 of file camera.hpp.

Member Function Documentation

◆ add_user_pointer() [1/2]

void chronoptics::tof::Camera::add_user_pointer ( uint8_t *  pointer,
size_t  capacity,
tof_user_pointer_destructed_t  callback,
void *  callback_user_data,
FrameType  frame_type 
)
inline

Add a pointer that will be filled with the specified data type.

This method allows you to fill data straight into your own data type without any additional copying.

Parameters
pointerThe pointer to the data to write into
capacityThe amount of data the pointer can hold
callbackCallback that will be called when pointer is no longer in use
callback_user_dataUser data that will be passed back when the function pointer is called
frame_typeThe frame type that will be filled into the pointer

Definition at line 216 of file camera.hpp.

◆ add_user_pointer() [2/2]

void chronoptics::tof::Camera::add_user_pointer ( uint8_t *  pointer,
size_t  capacity,
user_pointer_destructed_fn &  callback,
FrameType  frame_type 
)
inline

Add a pointer that will be filled with the specified data type.

This method allows you to fill data straight into your own data type without any additional copying.

Parameters
pointerThe pointer to the data to write into
capacityThe amount of data the pointer can hold
callbackCallback that will be called when pointer is no longer in use
frame_typeThe frame type that will be filled into the pointer

Definition at line 202 of file camera.hpp.

◆ clear_buffer()

void chronoptics::tof::Camera::clear_buffer ( )
inline

Clear the circular buffer used to store frames.

Definition at line 132 of file camera.hpp.

◆ clear_user_pointers()

void chronoptics::tof::Camera::clear_user_pointers ( )
inline

Clear all user pointers in memory.

Definition at line 222 of file camera.hpp.

◆ config_index()

uint32_t chronoptics::tof::Camera::config_index ( ) const
inline

Get the currently set configuration index.

Returns
config index

Definition at line 229 of file camera.hpp.

Referenced by switch_config().

◆ get_buffer_size()

size_t chronoptics::tof::Camera::get_buffer_size ( ) const
inline

Get the circular buffer size.

Returns
The maximum number of sets of frames that is stored before the oldest is overwritten

Definition at line 140 of file camera.hpp.

◆ get_calibration()

Calibration chronoptics::tof::Camera::get_calibration ( ) const
inline

Get calibration from the camera.

Returns
The calibration

Definition at line 172 of file camera.hpp.

◆ get_camera_config()

CameraConfig chronoptics::tof::Camera::get_camera_config ( ) const
inline

Get the currently active camera config.

Returns
The camera config

Definition at line 155 of file camera.hpp.

◆ get_frames()

std::vector< Data > chronoptics::tof::Camera::get_frames ( )
inline

Get data frames from camera.

Returns
Data frames

Definition at line 119 of file camera.hpp.

◆ get_multiple_camera_configurations()

std::vector< CameraConfig > chronoptics::tof::Camera::get_multiple_camera_configurations ( ) const
inline

Get all the set camera configurations.

Returns
Multiple camera configurations

Definition at line 279 of file camera.hpp.

◆ get_multiple_descriptions()

std::vector< const char * > chronoptics::tof::Camera::get_multiple_descriptions ( ) const
inline

Get the description for each configuration.

Returns
Descriptions

Definition at line 317 of file camera.hpp.

◆ get_multiple_names()

std::vector< const char * > chronoptics::tof::Camera::get_multiple_names ( ) const
inline

Get the name for each configuration.

Returns
Names

Definition at line 307 of file camera.hpp.

◆ get_multiple_processing_configurations()

std::vector< ProcessingConfig > chronoptics::tof::Camera::get_multiple_processing_configurations ( ) const
inline

Get all the set processing configurations.

Returns
Multiple processing configurations

Definition at line 293 of file camera.hpp.

◆ get_output_frame_types()

std::vector< FrameType > chronoptics::tof::Camera::get_output_frame_types ( ) const
inline

Get the frame types the camera should output.

Returns
Output frame types

Definition at line 254 of file camera.hpp.

◆ get_process_config()

ProcessingConfig chronoptics::tof::Camera::get_process_config ( ) const
inline

Get the processing config of the camera.

Returns
The processing config

Definition at line 95 of file camera.hpp.

◆ get_serial()

const char * chronoptics::tof::Camera::get_serial ( ) const
inline

Get the serial number of the current camera.

Returns
The serial

Definition at line 165 of file camera.hpp.

◆ get_set_stream_list()

std::vector< Stream > chronoptics::tof::Camera::get_set_stream_list ( )
inline

Get the stream list that is set on the camera.

Returns
The currently set streams

Definition at line 81 of file camera.hpp.

◆ get_stream_list()

std::vector< Stream > chronoptics::tof::Camera::get_stream_list ( ) const
inline

Get the different output streams the camera can provide.

Returns
The streams

Definition at line 53 of file camera.hpp.

◆ get_user_pointer_capacity()

size_t chronoptics::tof::Camera::get_user_pointer_capacity ( ) const
inline

Get the amount of user pointers that can be stored.

Returns
The capacity

Definition at line 182 of file camera.hpp.

◆ has_frames()

bool chronoptics::tof::Camera::has_frames ( ) const
inline

Check if the camera has frames available.

Returns
Has frames available

Definition at line 112 of file camera.hpp.

◆ has_multiple_configurations()

bool chronoptics::tof::Camera::has_multiple_configurations ( ) const
inline

Check if multiple configurations are set.

Switch config can only be used when this is the case.

Returns
Is set

Definition at line 272 of file camera.hpp.

◆ is_connected()

bool chronoptics::tof::Camera::is_connected ( ) const
inline

Check whether the camera is still connected.

Returns
Is connected

Definition at line 46 of file camera.hpp.

◆ is_stream_list_set()

bool chronoptics::tof::Camera::is_stream_list_set ( ) const
inline

Check whether the stream list is set.

Returns
Is stream list set

Definition at line 74 of file camera.hpp.

◆ is_streaming()

bool chronoptics::tof::Camera::is_streaming ( ) const
inline

Check whether the camera is streaming.

Returns
Is streaming

Definition at line 39 of file camera.hpp.

◆ possible_frame_types()

std::vector< FrameType > chronoptics::tof::Camera::possible_frame_types ( ) const
inline

Get the frame types that this camera can output.

Returns
Possible frame types

Definition at line 244 of file camera.hpp.

◆ set_buffer_size()

void chronoptics::tof::Camera::set_buffer_size ( size_t  size)
inline

Set the circular buffer size.

Parameters
sizeThe maximum number of sets of frames that is stored before the oldest is overwritten

Definition at line 148 of file camera.hpp.

◆ set_output_frame_types()

void chronoptics::tof::Camera::set_output_frame_types ( const std::vector< FrameType > &  output_frame_types)
inline

Set the frame types the camera should output.

Parameters
output_frame_typesOutput frame types

Definition at line 264 of file camera.hpp.

◆ set_process_config()

void chronoptics::tof::Camera::set_process_config ( ProcessingConfig config)
inline

Set the processing config of the camera.

Parameters
configThe processing config

Definition at line 105 of file camera.hpp.

◆ set_stream_list()

void chronoptics::tof::Camera::set_stream_list ( const std::vector< Stream > &  streams)
inline

Set the streams that you want to get from the camera.

Parameters
streamsThe wanted streams

Definition at line 67 of file camera.hpp.

◆ set_user_pointer_capacity()

void chronoptics::tof::Camera::set_user_pointer_capacity ( size_t  capacity)
inline

Set the amount of user pointers that can be stored.

Parameters
capacityThe capacity

Definition at line 189 of file camera.hpp.

◆ start()

void chronoptics::tof::Camera::start ( )
inline

Start streaming of the camera.

Definition at line 26 of file camera.hpp.

◆ stop()

void chronoptics::tof::Camera::stop ( )
inline

Stop streaming of the camera.

Definition at line 32 of file camera.hpp.

◆ switch_config()

void chronoptics::tof::Camera::switch_config ( uint32_t  config_index)
inline

Switch to a different config in real time, depending on configuration and camera, this can take 100-300ms.

Parameters
config_indexConfig index to switch to

Definition at line 237 of file camera.hpp.

References config_index().