21 const std::map<size_t, std::pair<int, int>>
tiles_map = { { 1,{ 1,1 } },
28 int main(
int argc,
char * argv[])
try 34 if (ctx.
get_device_count() == 0)
throw std::runtime_error(
"No device detected. Is it plugged in?");
37 std::vector<rs::stream> supported_streams;
44 for (
auto &
stream : supported_streams)
48 for (
auto &
stream : supported_streams)
52 std::cout <<
"Capturing " <<
stream <<
" at " << intrin.
width <<
" x " << intrin.height;
53 std::cout << std::setprecision(1) << std::fixed <<
", fov = " << intrin.hfov() <<
" x " << intrin.vfov() <<
", distortion = " << intrin.model() << std::endl;
61 std::ostringstream ss; ss <<
"CPP Capture Example (" << dev.
get_name() <<
")";
63 int rows =
tiles_map.at(supported_streams.size()).second;
81 std::cout <<
"Setting emitter to " << value << std::endl;
89 std::cout <<
"Setting auto exposure to " << value << std::endl;
106 glViewport(0, 0, w, h);
107 glClear(GL_COLOR_BUFFER_BIT);
112 glOrtho(0, w, h, 0, -1, +1);
132 catch (
const std::exception & e)
134 std::cerr << e.what() << std::endl;
void log_to_console(log_severity min_severity)
Provides convenience methods relating to devices.
intrinsics get_stream_intrinsics(stream stream) const
Retrieves intrinsic camera parameters for specific stream.
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.
GLFWAPI void glfwGetWindowSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the client area of the specified window.
bool color_rectification_enabled
const std::string & get_failed_args() const
GLFWAPI void * glfwGetWindowUserPointer(GLFWwindow *window)
Returns the user pointer of the specified window.
Exposes librealsense functionality for C++ compilers.
GLfloat GLfloat GLfloat GLfloat h
struct GLFWwindow GLFWwindow
Opaque window object.
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
void show(float rx, float ry, float rw, float rh) const
const std::map< size_t, std::pair< int, int > > tiles_map
GLFWAPI void glfwSetWindowUserPointer(GLFWwindow *window, void *pointer)
Sets the user pointer of the specified window.
stream
Streams are different types of data provided by RealSense devices.
bool is_stream_enabled(stream stream) const
Determines if specific stream is enabled.
const char * get_name() const
Retrieves human-readable device model string.
typedef int(WINAPI *PFNWGLRELEASEPBUFFERDCARBPROC)(HPBUFFERARB hPbuffer
void start(rs::source source=rs::source::video)
Begins streaming on all enabled streams for this device.
GLFWAPI void glfwSwapBuffers(GLFWwindow *window)
Swaps the front and back buffers of the specified window.
GLFWAPI void glfwMakeContextCurrent(GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
double get_option(option option)
Retrieves current value of single option.
int main(int argc, char *argv[])
bool align_color_to_depth
GLsizei const GLfloat * value
bool supports_option(option option) const
Determines if device allows specific option to be queried and set.
bool align_depth_to_color
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
GLFWAPI void glfwDestroyWindow(GLFWwindow *window)
Destroys the specified window and its context.
GLFWAPI void glfwGetFramebufferSize(GLFWwindow *window, int *width, int *height)
Retrieves the size of the framebuffer of the specified window.
GLFWAPI void glfwTerminate(void)
Terminates the GLFW library.
GLFWAPI void glfwPollEvents(void)
Processes all pending events.
bool supports(capabilities capability) const
Determines device capabilities.
device * get_device(int index)
void set_option(option option, double value)
Sets current value of single option.
const std::string & get_failed_function() const
capabilities
Specifies various capabilities of a RealSense device.
GLubyte GLubyte GLubyte GLubyte w
void wait_for_frames()
Blocks until new frames are available.
int get_device_count() const
GLFWAPI int glfwWindowShouldClose(GLFWwindow *window)
Checks the close flag of the specified window.