19 #define STREAM RS2_STREAM_DEPTH // rs2_stream is a types of data provided by RealSense device // 20 #define FORMAT RS2_FORMAT_Z16 // rs2_format identifies how binary data is encoded within a frame // 21 #define WIDTH 640 // Defines the number of columns for each frame or zero for auto resolve// 22 #define HEIGHT 0 // Defines the number of lines for each frame or zero for auto resolve // 23 #define FPS 30 // Defines the rate of frames per second // 24 #define STREAM_INDEX 0 // Defines the stream index, used for multiple streams of the same type // 44 printf(
"There are %d connected RealSense devices.\n", dev_count);
74 printf(
"The connected device doesn't support depth streaming!\n");
91 for (i = 0; i < num_of_frames; ++
i)
113 printf(
"The camera is facing an object %.3f meters away.\n", dist_to_center);
void rs2_config_enable_stream(rs2_config *config, rs2_stream stream, int index, int width, int height, rs2_format format, int framerate, rs2_error **error)
void print_device_info(rs2_device *dev)
Exposes RealSense processing-block functionality for C compilers.
rs2_device_list * rs2_query_devices(const rs2_context *context, rs2_error **error)
int rs2_is_frame_extendable_to(const rs2_frame *frame, rs2_extension extension_type, rs2_error **error)
void rs2_delete_device(rs2_device *device)
rs2_context * rs2_create_context(int api_version, rs2_error **error)
Creates RealSense context that is required for the rest of the API.
rs2_config * rs2_create_config(rs2_error **error)
void rs2_delete_context(rs2_context *context)
Frees the relevant context object.
rs2_pipeline * rs2_create_pipeline(rs2_context *ctx, rs2_error **error)
rs2_device * rs2_create_device(const rs2_device_list *info_list, int index, rs2_error **error)
void check_error(rs2_error *e)
Exposes librealsense functionality for C compilers.
int rs2_get_frame_height(const rs2_frame *frame, rs2_error **error)
rs2_frame * rs2_pipeline_wait_for_frames(rs2_pipeline *pipe, unsigned int timeout_ms, rs2_error **error)
Exposes RealSense frame functionality for C compilers.
int rs2_embedded_frames_count(rs2_frame *composite, rs2_error **error)
int rs2_get_frame_width(const rs2_frame *frame, rs2_error **error)
float rs2_depth_frame_get_distance(const rs2_frame *frame_ref, int x, int y, rs2_error **error)
GLint GLsizei GLsizei height
#define RS2_DEFAULT_TIMEOUT
Exposes sensor options functionality for C compilers.
static const textual_icon exit
rs2_pipeline_profile * rs2_pipeline_start_with_config(rs2_pipeline *pipe, rs2_config *config, rs2_error **error)
void rs2_pipeline_stop(rs2_pipeline *pipe, rs2_error **error)
void rs2_delete_config(rs2_config *config)
void rs2_release_frame(rs2_frame *frame)
rs2_frame * rs2_extract_frame(rs2_frame *composite, int index, rs2_error **error)
void rs2_delete_device_list(rs2_device_list *info_list)
void rs2_delete_pipeline_profile(rs2_pipeline_profile *profile)
int rs2_get_device_count(const rs2_device_list *info_list, rs2_error **error)
void rs2_delete_pipeline(rs2_pipeline *pipe)
struct rs2_frame rs2_frame