16 printf(
"There are %d connected RealSense devices.\n", ctx.
get_device_count());
21 printf(
"\nUsing device 0, an %s\n", dev->
get_name());
22 printf(
" Serial number: %s\n", dev->
get_serial());
31 const uint16_t one_meter =
static_cast<uint16_t
>(1.0f / dev->
get_depth_scale());
43 char buffer[(640/10+1)*(480/20)+1];
45 int coverage[64] = {};
46 for(
int y=0;
y<480; ++
y)
48 for(
int x=0;
x<640; ++
x)
50 int depth = *depth_frame++;
51 if(depth > 0 && depth < one_meter) ++coverage[
x/10];
56 for(
int &
c : coverage)
58 *out++ =
" .:nhBXWW"[
c/25];
65 printf(
"\n%s", buffer);
74 printf(
" %s\n", e.what());
Provides convenience methods relating to devices.
void enable_stream(stream stream, int width, int height, format format, int framerate, output_buffer_format output_buffer_type=output_buffer_format::continous)
Enables specific stream and requests specific properties.
const std::string & get_failed_args() const
const char * get_firmware_version() const
Retrieves version of firmware currently installed on device.
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei GLsizei depth
Exposes librealsense functionality for C++ compilers.
const void * get_frame_data(stream stream) const
Retrieves contents of latest frame on a stream.
const char * get_name() const
Retrieves human-readable device model string.
void start(rs::source source=rs::source::video)
Begins streaming on all enabled streams for this device.
const char * get_serial() const
Retrieves unique serial number of device.
float get_depth_scale() const
Retrieves mapping between units of depth image and meters.
device * get_device(int index)
const std::string & get_failed_function() const
GLint GLint GLint GLint GLint x
void wait_for_frames()
Blocks until new frames are available.
int get_device_count() const