4 #ifndef LIBREALSENSE_RS2_SENSOR_HPP 5 #define LIBREALSENSE_RS2_SENSOR_HPP 73 return _serialized_data;
77 std::string _description;
78 double _timestamp = -1;
81 std::string _serialized_data;
87 T on_notification_function;
108 on_frame_function(
frame{ fref });
211 _options = other._options;
260 return is_supported > 0;
281 void open(
const std::vector<stream_profile>& profiles)
const 285 std::vector<const rs2_stream_profile*> profs;
286 profs.reserve(profiles.size());
287 for (
auto& p : profiles)
289 profs.push_back(p.get());
294 static_cast<int>(profiles.size()),
352 std::vector<stream_profile> results;
355 std::shared_ptr<rs2_stream_profile_list> list(
363 for (
auto i = 0; i < size; i++)
367 results.push_back(profile);
390 operator bool()
const 395 const std::shared_ptr<rs2_sensor>&
get()
const 423 explicit sensor(std::shared_ptr<rs2_sensor> dev)
469 operator bool()
const {
return _sensor.get() !=
nullptr; }
497 operator bool()
const {
return _sensor.get() !=
nullptr; }
524 operator bool()
const {
return _sensor.get() !=
nullptr; }
527 #endif // LIBREALSENSE_RS2_SENSOR_HPP Definition: rs_frame.hpp:21
rs2_camera_info
Read-only strings that can be queried from the device. Not all information attributes are available o...
Definition: rs_sensor.h:22
Definition: rs_types.hpp:25
Definition: rs_sensor.hpp:232
bool operator==(const sensor &lhs, const sensor &rhs)
Definition: rs_sensor.hpp:429
float rs2_get_option(const rs2_options *options, rs2_option option, rs2_error **error)
Definition: rs_frame.hpp:202
Definition: rs_types.hpp:161
float rs2_get_depth_scale(rs2_sensor *sensor, rs2_error **error)
void release() override
Definition: rs_sensor.hpp:111
bool supports(rs2_option option) const
Definition: rs_sensor.hpp:122
friend device
Definition: rs_sensor.hpp:417
void stop() const
Definition: rs_sensor.hpp:325
std::vector< stream_profile > get_stream_profiles() const
Definition: rs_sensor.hpp:350
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
region_of_interest get_region_of_interest() const
Definition: rs_sensor.hpp:460
void on_notification(rs2_notification *_notification) override
Definition: rs_sensor.hpp:91
Definition: rs_types.hpp:39
virtual ~options()=default
Definition: rs_sensor.hpp:472
void start(T callback) const
Definition: rs_sensor.hpp:315
int min_x
Definition: rs_types.hpp:163
Definition: rs_sensor.h:24
void rs2_set_region_of_interest(const rs2_sensor *sensor, int min_x, int min_y, int max_x, int max_y, rs2_error **error)
sets the active region of interest to be used by auto-exposure algorithm
depth_sensor(sensor s)
Definition: rs_sensor.hpp:475
friend context
Definition: rs_sensor.hpp:415
float min
Definition: rs_types.hpp:155
void rs2_stop(const rs2_sensor *sensor, rs2_error **error)
options & operator=(const T &dev)
Definition: rs_sensor.hpp:220
depth_stereo_sensor(sensor s)
Definition: rs_sensor.hpp:503
void release() override
Definition: rs_sensor.hpp:96
const char * rs2_get_notification_serialized_data(rs2_notification *notification, rs2_error **error)
Definition: rs_context.hpp:11
bool supports(rs2_camera_info info) const
Definition: rs_sensor.hpp:255
Definition: rs_sensor.h:23
notification(rs2_notification *notification)
Definition: rs_sensor.hpp:15
rs2_log_severity rs2_get_notification_severity(rs2_notification *notification, rs2_error **error)
Definition: rs_types.h:103
const char * get_option_description(rs2_option option) const
Definition: rs_sensor.hpp:135
int max_y
Definition: rs_types.hpp:166
sensor(std::shared_ptr< rs2_sensor > dev)
Definition: rs_sensor.hpp:423
friend roi_sensor
Definition: rs_sensor.hpp:419
void set_region_of_interest(const region_of_interest &roi)
Definition: rs_sensor.hpp:453
int max_x
Definition: rs_types.hpp:165
options(const options &other)
Definition: rs_sensor.hpp:226
rs2_notification_category get_category() const
Definition: rs_sensor.hpp:36
float max
Definition: rs_types.hpp:156
float step
Definition: rs_types.hpp:158
void rs2_open(rs2_sensor *device, const rs2_stream_profile *profile, rs2_error **error)
notifications_callback(T on_notification)
Definition: rs_sensor.hpp:89
frame_callback(T on_frame)
Definition: rs_sensor.hpp:104
float get_option(rs2_option option) const
Definition: rs_sensor.hpp:162
Definition: rs_sensor.hpp:100
double get_timestamp() const
Definition: rs_sensor.hpp:53
void open(const stream_profile &profile) const
Definition: rs_sensor.hpp:241
int rs2_supports_option(const rs2_options *options, rs2_option option, rs2_error **error)
void set_notifications_callback(T callback) const
Definition: rs_sensor.hpp:337
struct rs2_notification rs2_notification
Definition: rs_types.h:173
std::shared_ptr< rs2_sensor > _sensor
Definition: rs_sensor.hpp:421
Definition: rs_types.h:102
const char * rs2_get_option_value_description(const rs2_options *options, rs2_option option, float value, rs2_error **error)
Definition: rs_sensor.hpp:12
friend device_base
Definition: rs_sensor.hpp:418
Definition: rs_types.h:113
Definition: rs_types.hpp:153
void rs2_get_region_of_interest(const rs2_sensor *sensor, int *min_x, int *min_y, int *max_x, int *max_y, rs2_error **error)
gets the active region of interest to be used by auto-exposure algorithm
rs2_time_t rs2_get_notification_timestamp(rs2_notification *notification, rs2_error **error)
sensor()
Definition: rs_sensor.hpp:388
const rs2_stream_profile * rs2_get_stream_profile(const rs2_stream_profile_list *list, int index, rs2_error **error)
void rs2_set_notifications_callback_cpp(const rs2_sensor *sensor, rs2_notifications_callback *callback, rs2_error **error)
Definition: rs_sensor.hpp:114
const char * get_option_value_description(rs2_option option, float val) const
Definition: rs_sensor.hpp:149
T as() const
Definition: rs_sensor.hpp:408
void rs2_get_option_range(const rs2_options *sensor, rs2_option option, float *min, float *max, float *step, float *def, rs2_error **error)
int rs2_supports_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
struct rs2_options rs2_options
Definition: rs_types.h:171
Definition: rs_sensor.hpp:85
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
std::string get_serialized_data() const
Definition: rs_sensor.hpp:71
bool is() const
Definition: rs_sensor.hpp:401
void close() const
Definition: rs_sensor.hpp:303
options(rs2_options *o=nullptr)
Definition: rs_sensor.hpp:217
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:79
Definition: rs_types.h:89
void open(const std::vector< stream_profile > &profiles) const
Definition: rs_sensor.hpp:281
float get_stereo_baseline() const
Definition: rs_sensor.hpp:516
Definition: rs_types.h:24
int rs2_is_sensor_extendable_to(const rs2_sensor *sensor, rs2_extension extension, rs2_error **error)
rs2_log_severity get_severity() const
Definition: rs_sensor.hpp:62
bool is_option_read_only(rs2_option option) const
Definition: rs_sensor.hpp:201
void on_frame(rs2_frame *fref) override
Definition: rs_sensor.hpp:106
rs2_notification_category
Category of the librealsense notifications.
Definition: rs_types.h:17
option_range get_option_range(rs2_option option) const
Definition: rs_sensor.hpp:174
void set_option(rs2_option option, float value) const
Definition: rs_sensor.hpp:189
void rs2_delete_stream_profiles_list(rs2_stream_profile_list *list)
float def
Definition: rs_types.hpp:157
void rs2_close(const rs2_sensor *sensor, rs2_error **error)
rs2_stream_profile_list * rs2_get_stream_profiles(rs2_sensor *device, rs2_error **error)
const char * rs2_get_option_description(const rs2_options *options, rs2_option option, rs2_error **error)
options & operator=(const options &other)
Definition: rs_sensor.hpp:209
int rs2_is_option_read_only(const rs2_options *options, rs2_option option, rs2_error **error)
void rs2_open_multiple(rs2_sensor *device, const rs2_stream_profile **profiles, int count, rs2_error **error)
void rs2_start_cpp(const rs2_sensor *sensor, rs2_frame_callback *callback, rs2_error **error)
Definition: rs_sensor.hpp:439
friend device_list
Definition: rs_sensor.hpp:416
rs2_notification_category rs2_get_notification_category(rs2_notification *notification, rs2_error **error)
std::string get_description() const
Definition: rs_sensor.hpp:44
float get_depth_scale() const
Definition: rs_sensor.hpp:489
const char * rs2_get_sensor_info(const rs2_sensor *sensor, rs2_camera_info info, rs2_error **error)
sensor & operator=(const sensor &other)
Definition: rs_sensor.hpp:381
const char * rs2_get_notification_description(rs2_notification *notification, rs2_error **error)
int rs2_get_stream_profiles_count(const rs2_stream_profile_list *list, rs2_error **error)
const std::shared_ptr< rs2_sensor > & get() const
Definition: rs_sensor.hpp:395
void rs2_set_option(const rs2_options *options, rs2_option option, float value, rs2_error **error)
struct rs2_error rs2_error
Definition: rs_types.h:149
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:82
Definition: rs_sensor.hpp:500
sensor & operator=(const std::shared_ptr< rs2_sensor > other)
Definition: rs_sensor.hpp:373
const char * get_info(rs2_camera_info info) const
Definition: rs_sensor.hpp:268
int min_y
Definition: rs_types.hpp:164
struct rs2_frame rs2_frame
Definition: rs_types.h:151
roi_sensor(sensor s)
Definition: rs_sensor.hpp:442