Intel® RealSense™ Cross Platform API  2.13.0
Intel Realsense Cross-platform API
rs.hpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3 
4 #ifndef LIBREALSENSE_RS2_HPP
5 #define LIBREALSENSE_RS2_HPP
6 
7 #include "rs.h"
8 #include "hpp/rs_types.hpp"
9 #include "hpp/rs_context.hpp"
10 #include "hpp/rs_device.hpp"
11 #include "hpp/rs_frame.hpp"
12 #include "hpp/rs_processing.hpp"
14 #include "hpp/rs_sensor.hpp"
15 #include "hpp/rs_pipeline.hpp"
16 
17 namespace rs2
18 {
19  inline void log_to_console(rs2_log_severity min_severity)
20  {
21  rs2_error* e = nullptr;
22  rs2_log_to_console(min_severity, &e);
23  error::handle(e);
24  }
25 
26  inline void log_to_file(rs2_log_severity min_severity, const char * file_path = nullptr)
27  {
28  rs2_error* e = nullptr;
29  rs2_log_to_file(min_severity, file_path, &e);
30  error::handle(e);
31  }
32 
33  inline void log(rs2_log_severity severity, const char* message)
34  {
35  rs2_error* e = nullptr;
36  rs2_log(severity, message, &e);
37  error::handle(e);
38  }
39 }
40 
41 inline std::ostream & operator << (std::ostream & o, rs2_stream stream) { return o << rs2_stream_to_string(stream); }
42 inline std::ostream & operator << (std::ostream & o, rs2_format format) { return o << rs2_format_to_string(format); }
43 inline std::ostream & operator << (std::ostream & o, rs2_distortion distortion) { return o << rs2_distortion_to_string(distortion); }
44 inline std::ostream & operator << (std::ostream & o, rs2_option option) { return o << rs2_option_to_string(option); }
45 inline std::ostream & operator << (std::ostream & o, rs2_log_severity severity) { return o << rs2_log_severity_to_string(severity); }
46 inline std::ostream & operator << (std::ostream & o, rs2_camera_info camera_info) { return o << rs2_camera_info_to_string(camera_info); }
47 inline std::ostream & operator << (std::ostream & o, rs2_frame_metadata_value metadata) { return o << rs2_frame_metadata_to_string(metadata); }
48 inline std::ostream & operator << (std::ostream & o, rs2_timestamp_domain domain) { return o << rs2_timestamp_domain_to_string(domain); }
49 inline std::ostream & operator << (std::ostream & o, rs2_notification_category notificaton) { return o << rs2_notification_category_to_string(notificaton); }
50 inline std::ostream & operator << (std::ostream & o, rs2_sr300_visual_preset preset) { return o << rs2_sr300_visual_preset_to_string(preset); }
51 inline std::ostream & operator << (std::ostream & o, rs2_exception_type exception_type) { return o << rs2_exception_type_to_string(exception_type); }
52 inline std::ostream & operator << (std::ostream & o, rs2_playback_status status) { return o << rs2_playback_status_to_string(status); }
53 
54 #endif // LIBREALSENSE_RS2_HPP
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
const char * rs2_format_to_string(rs2_format format)
rs2_exception_type
Exception types are the different categories of errors that RealSense API might return.
Definition: rs_types.h:29
const char * rs2_timestamp_domain_to_string(rs2_timestamp_domain info)
const char * rs2_frame_metadata_to_string(rs2_frame_metadata_value metadata)
rs2_option
Defines general configuration controls. These can generally be mapped to camera UVC controls...
Definition: rs_option.h:22
rs2_distortion
Distortion model: defines how pixel coordinates should be mapped to sensor coordinates.
Definition: rs_types.h:44
rs2_sr300_visual_preset
For SR300 devices: provides optimized settings (presets) for specific types of usage.
Definition: rs_option.h:72
const char * rs2_option_to_string(rs2_option option)
const char * rs2_distortion_to_string(rs2_distortion distortion)
void rs2_log_to_file(rs2_log_severity min_severity, const char *file_path, rs2_error **error)
void log(rs2_log_severity severity, const char *message)
Definition: rs.hpp:33
Definition: rs_context.hpp:11
void rs2_log(rs2_log_severity severity, const char *message, rs2_error **error)
const char * rs2_sr300_visual_preset_to_string(rs2_sr300_visual_preset preset)
Exposes librealsense functionality for C compilers.
const char * rs2_exception_type_to_string(rs2_exception_type type)
rs2_playback_status
Definition: rs_record_playback.h:19
rs2_format
Format identifies how binary data is encoded within a frame.
Definition: rs_sensor.h:55
void log_to_file(rs2_log_severity min_severity, const char *file_path=nullptr)
Definition: rs.hpp:26
static void handle(rs2_error *e)
Definition: rs_types.hpp:121
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:38
void log_to_console(rs2_log_severity min_severity)
Definition: rs.hpp:19
const char * rs2_camera_info_to_string(rs2_camera_info info)
void rs2_log_to_console(rs2_log_severity min_severity, rs2_error **error)
const char * rs2_stream_to_string(rs2_stream stream)
rs2_notification_category
Category of the librealsense notifications.
Definition: rs_types.h:17
const char * rs2_playback_status_to_string(rs2_playback_status status)
std::ostream & operator<<(std::ostream &o, rs2_stream stream)
Definition: rs.hpp:41
const char * rs2_notification_category_to_string(rs2_notification_category category)
const char * rs2_log_severity_to_string(rs2_log_severity info)
struct rs2_error rs2_error
Definition: rs_types.h:149
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:82
rs2_frame_metadata_value
Per-Frame-Metadata are set of read-only properties that might be exposed for each individual frame...
Definition: rs_frame.h:28
rs2_timestamp_domain
Specifies the clock in relation to which the frame timestamp was measured.
Definition: rs_frame.h:19