RealSense Cross Platform API
RealSense Cross-platform API
rs.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2017 RealSense, Inc. All Rights Reserved. */
3 
9 #ifndef LIBREALSENSE_RS2_H
10 #define LIBREALSENSE_RS2_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include "rsutil.h"
17 #include "h/rs_types.h"
18 #include "h/rs_context.h"
19 #include "h/rs_device.h"
20 #include "h/rs_frame.h"
21 #include "h/rs_option.h"
22 #include "h/rs_processing.h"
23 #include "h/rs_record_playback.h"
24 #include "h/rs_sensor.h"
25 #include "h/rs_safety_sensor.h"
26 #include "h/rs_eth_config.h"
27 #include "h/rs_rum.h"
28 #include "h/rs_composite_option.h"
30 #include "h/rs_hdrd_control.h"
32 
33 #define RS2_API_MAJOR_VERSION 2
34 #define RS2_API_MINOR_VERSION 59
35 #define RS2_API_PATCH_VERSION 1
36 #define RS2_API_BUILD_VERSION 0
37 
38 #ifndef STRINGIFY
39 #define STRINGIFY(arg) #arg
40 #endif
41 #ifndef VAR_ARG_STRING
42 #define VAR_ARG_STRING(arg) STRINGIFY(arg)
43 #endif
44 
45 /* Versioning rules : For each release at least one of [MJR/MNR/PTCH] triple is promoted */
46 /* : Versions that differ by MAJOR/MINOR VERSION component can introduce API changes */
47 /* Version in encoded integer format (1,9,x) -> 01090x. note that each component is limited into [0-99] range by design */
48 #define RS2_API_VERSION (((RS2_API_MAJOR_VERSION) * 10000) + ((RS2_API_MINOR_VERSION) * 100) + (RS2_API_PATCH_VERSION))
49 /* Return version in "X.Y.Z" format */
50 #define RS2_API_VERSION_STR (VAR_ARG_STRING(RS2_API_MAJOR_VERSION.RS2_API_MINOR_VERSION.RS2_API_PATCH_VERSION))
51 #define RS2_API_FULL_VERSION_STR (VAR_ARG_STRING(RS2_API_MAJOR_VERSION.RS2_API_MINOR_VERSION.RS2_API_PATCH_VERSION.RS2_API_BUILD_VERSION))
52 
65 #define RS2_CONFIG_FILENAME "realsense-config.json"
66 
73 int rs2_get_raw_data_size(const rs2_raw_data_buffer* buffer, rs2_error** error);
74 
79 void rs2_delete_raw_data(const rs2_raw_data_buffer* buffer);
80 
87 const unsigned char* rs2_get_raw_data(const rs2_raw_data_buffer* buffer, rs2_error** error);
88 
94 int rs2_get_api_version(rs2_error** error);
95 
96 void rs2_log_to_console(rs2_log_severity min_severity, rs2_error ** error);
97 
98 void rs2_log_to_file(rs2_log_severity min_severity, const char * file_path, rs2_error ** error);
99 
100 void rs2_log_to_callback_cpp( rs2_log_severity min_severity, rs2_log_callback * callback, rs2_error ** error );
101 
102 void rs2_log_to_callback( rs2_log_severity min_severity, rs2_log_callback_ptr callback, void * arg, rs2_error** error );
103 
104 void rs2_reset_logger( rs2_error ** error);
105 
114 void rs2_enable_rolling_log_file( unsigned max_size, rs2_error ** error );
115 
116 
117 unsigned rs2_get_log_message_line_number( rs2_log_message const * msg, rs2_error** error );
118 const char * rs2_get_log_message_filename( rs2_log_message const * msg, rs2_error** error );
119 const char * rs2_get_raw_log_message( rs2_log_message const * msg, rs2_error** error );
120 const char * rs2_get_full_log_message( rs2_log_message const * msg, rs2_error** error );
121 
128 void rs2_log(rs2_log_severity severity, const char * message, rs2_error ** error);
129 
136 float rs2_depth_frame_get_distance(const rs2_frame* frame_ref, int x, int y, rs2_error** error);
137 
144 
145 void rs2_hw_monitor_get_opcode_string(int opcode, char* buffer, size_t buffer_size,rs2_device* device, rs2_error** error);
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 #endif
Exposes RUM (Real User Monitoring) functionality for C compilers.
struct rs2_raw_data_buffer rs2_raw_data_buffer
Definition: rs_types.h:298
int rs2_get_api_version(rs2_error **error)
const char * rs2_get_full_log_message(rs2_log_message const *msg, rs2_error **error)
void rs2_enable_rolling_log_file(unsigned max_size, rs2_error **error)
void rs2_log_to_callback_cpp(rs2_log_severity min_severity, rs2_log_callback *callback, rs2_error **error)
Cast-target struct for RS2_COMPOSITE_OPTION_HDRD_CONTROL (see rs_composite_option.h). Wire layout: dpp_header + 8 int32 param slots, 7 used (38 bytes, little-endian, pack(1)); ctl_id = 0x0008. Open item: activates at 720p/960p only - resolution-gating not yet encoded here.
void rs2_log_to_file(rs2_log_severity min_severity, const char *file_path, rs2_error **error)
const unsigned char * rs2_get_raw_data(const rs2_raw_data_buffer *buffer, rs2_error **error)
const char * rs2_get_log_message_filename(rs2_log_message const *msg, rs2_error **error)
unsigned rs2_get_log_message_line_number(rs2_log_message const *msg, rs2_error **error)
Generic entry points shared by every composite (multi-field, atomically-exchanged) XU control...
void rs2_log(rs2_log_severity severity, const char *message, rs2_error **error)
void rs2_delete_raw_data(const rs2_raw_data_buffer *buffer)
void(* rs2_log_callback_ptr)(rs2_log_severity, rs2_log_message const *, void *arg)
Definition: rs_types.h:334
Definition: rs_types.hpp:60
int rs2_get_raw_data_size(const rs2_raw_data_buffer *buffer, rs2_error **error)
Exposes RealSense safety sensor functionality for C compilers.
void rs2_log_to_callback(rs2_log_severity min_severity, rs2_log_callback_ptr callback, void *arg, rs2_error **error)
Exposes RealSense frame functionality for C compilers.
rs2_time_t rs2_get_time(rs2_error **error)
Exposes RealSense structs.
Exposes record and playback functionality for C compilers.
Exposes RealSense processing-block functionality for C compilers.
float rs2_depth_frame_get_distance(const rs2_frame *frame_ref, int x, int y, rs2_error **error)
struct rs2_log_message rs2_log_message
Definition: rs_types.h:297
Exposes RealSense device functionality for C compilers.
Exposes RealSense sensor functionality for C compilers.
const char * rs2_get_raw_log_message(rs2_log_message const *msg, rs2_error **error)
Exposes sensor options functionality for C compilers.
Exposes RealSense ethernet configuration functionality for C compilers.
void rs2_log_to_console(rs2_log_severity min_severity, rs2_error **error)
void rs2_hw_monitor_get_opcode_string(int opcode, char *buffer, size_t buffer_size, rs2_device *device, rs2_error **error)
Cast-target struct for RS2_COMPOSITE_OPTION_DECIMATION_FILTER_DPP (see rs_composite_option.h). Same shared HKR DPP wire layout (see rs_hdrd_control.h): dpp_header + 8 int32 param slots, 2 used (38 bytes, little-endian, pack(1)); ctl_id = 0x0001.
Cast-target struct for RS2_COMPOSITE_OPTION_TEMPORAL_FILTER_DPP (see rs_composite_option.h). Same shared HKR DPP wire layout (see rs_hdrd_control.h): dpp_header + 8 int32 param slots, 4 used (38 bytes, little-endian, pack(1)); ctl_id = 0x0002.
struct rs2_device rs2_device
Definition: rs_types.h:295
Exposes RealSense context functionality for C compilers.
struct rs2_error rs2_error
Definition: rs_types.h:296
double rs2_time_t
Definition: rs_types.h:343
rs2_log_severity
Severity of the librealsense logger.
Definition: rs_types.h:139
void rs2_reset_logger(rs2_error **error)
struct rs2_frame rs2_frame
Definition: rs_types.h:299