63 int rows = (height / 20);
64 int row_lenght = (width / 10);
65 int display_size = (rows + 1) * (row_lenght + 1);
67 char *
buffer = (
char*)malloc(display_size *
sizeof(
char));
70 printf(
"Failed to allocate application memory");
85 int coverage[255] = { 0 },
x,
y, i;
90 int depth = *depth_frame++;
91 if (depth > 0 && depth < one_meter) ++coverage[
x / 10];
96 for (i = 0; i < (row_lenght); ++i)
98 *out++ =
" .:nhBXWW"[coverage[i] / 25];
105 printf(
"\n%s", buffer);
void rs_get_stream_intrinsics(const rs_device *device, rs_stream stream, rs_intrinsics *intrin, rs_error **error)
Retrieves intrinsic camera parameters for a specific stream.
int rs_get_device_count(const rs_context *context, rs_error **error)
Determines number of connected devices.
GLint GLint GLsizei GLsizei height
GLint GLint GLint GLint GLint GLint y
const void * rs_get_frame_data(const rs_device *device, rs_stream stream, rs_error **error)
Retrieves the contents of the latest frame on a stream.
GLint GLint GLsizei GLsizei GLsizei depth
const char * rs_get_device_name(const rs_device *device, rs_error **error)
Retrieves human-readable device model string.
const char * rs_get_error_message(const rs_error *error)
Returns static pointer to error message.
float rs_get_device_depth_scale(const rs_device *device, rs_error **error)
Retrieves mapping between the units of the depth image and meters.
Exposes librealsense functionality for C compilers.
const char * rs_get_failed_function(const rs_error *error)
Returns static pointer to name of a failing function in case of error.
rs_context * rs_create_context(int api_version, rs_error **error)
Creates RealSense context that is required for the rest of the API.
const char * rs_get_device_firmware_version(const rs_device *device, rs_error **error)
Retrieves the version of the firmware currently installed on the device.
void rs_enable_stream(rs_device *device, rs_stream stream, int width, int height, rs_format format, int framerate, rs_error **error)
Enables a specific stream and requests specific properties.
const char * rs_get_failed_args(const rs_error *error)
Returns static pointer to arguments of a failing function in case of error.
rs_stream
Streams are different types of data provided by RealSense devices.
GLint GLint GLsizei width
rs_device * rs_get_device(rs_context *context, int index, rs_error **error)
Retrieves connected device by index.
const char * rs_get_device_serial(const rs_device *device, rs_error **error)
Retrieves unique serial number of the device.
void rs_wait_for_frames(rs_device *device, rs_error **error)
Blocks until new frames are available.
void rs_start_device(rs_device *device, rs_error **error)
Begins streaming on all enabled streams for this device.
void rs_stop_device(rs_device *device, rs_error **error)
Ends data acquisition for the specified source providers.
GLint GLint GLint GLint GLint x