9 #include "../include/librealsense2/h/rs_types.h" 10 #include "../include/librealsense2-gl/rs_processing_gl.h" 32 std::shared_ptr<gl::context>
ctx;
73 auto block = std::make_shared<librealsense::gl::yuy2rgb>();
74 auto backup = std::make_shared<librealsense::yuy2_converter>(
RS2_FORMAT_RGB8);
75 auto dual = std::make_shared<librealsense::gl::dual_processing_block>();
88 if (!gpu)
throw std::runtime_error(
"Expected GPU frame!");
91 if (!gpu->get_gpu_section().input_texture(
id, &
res))
92 throw std::runtime_error(
"Texture not ready!");
105 switch (extension_type)
110 if (!gpu)
return false;
112 if (!gpu->get_gpu_section())
return false;
114 if (!gpu->get_gpu_section().on_gpu())
return false;
117 default:
return false;
125 auto block = std::make_shared<librealsense::gl::colorizer>();
126 auto backup = std::make_shared<librealsense::colorizer>();
127 auto dual = std::make_shared<librealsense::gl::dual_processing_block>();
137 auto block = std::make_shared<librealsense::gl::align_gl>(to);
138 auto backup = std::make_shared<librealsense::align>(to);
139 auto dual = std::make_shared<librealsense::gl::dual_processing_block>();
149 auto block = std::make_shared<librealsense::gl::pointcloud_gl>();
151 auto dual = std::make_shared<librealsense::gl::dual_processing_block>();
161 if (!ptr)
throw std::runtime_error(
"Processing block does not support matrix setting");
164 ptr->set_matrix(
type, m);
235 auto block = std::make_shared<librealsense::gl::camera_renderer>();
243 auto block = std::make_shared<librealsense::gl::upload>();
251 auto block = std::make_shared<librealsense::gl::pointcloud_renderer>();
256 #ifdef BUILD_EASYLOGGINGPP 260 char log_gl_name[] =
"librealsense";
261 static logger_type<log_gl_name> logger_gl;
void rs2_gl_init_rendering(int api_version, int use_glsl, rs2_error **error) BEGIN_API_CALL
rs2_processing_block * rs2_gl_create_yuy_decoder(int api_version, rs2_error **error) BEGIN_API_CALL
const char * get_string(rs2_rs400_visual_preset value)
void init(GLFWwindow *share_with, glfw_binding binding, bool use_glsl)
typedef void(APIENTRY *GLDEBUGPROC)(GLenum source
The header of the GLFW 3 API.
void rs2_gl_init_processing_glfw(int api_version, GLFWwindow *share_with, glfw_binding bindings, int use_glsl, rs2_error **error) BEGIN_API_CALL
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
void rs2_gl_shutdown_processing(int api_version, rs2_error **error) BEGIN_API_CALL
rs2_processing_block * rs2_gl_create_uploader(int api_version, rs2_error **error) BEGIN_API_CALL
void verify_version_compatibility(int api_version)
unsigned int rs2_gl_frame_get_texture_id(const rs2_frame *frame_ref, unsigned int id, rs2_error **error) BEGIN_API_CALL
rs2_processing_block * rs2_gl_create_colorizer(int api_version, rs2_error **error) BEGIN_API_CALL
const char * rs2_gl_matrix_type_to_string(rs2_gl_matrix_type type)
rs2_processing_block * rs2_gl_create_camera_renderer(int api_version, rs2_error **error) BEGIN_API_CALL
rs2_processing_block * rs2_gl_create_align(int api_version, rs2_stream to, rs2_error **error) BEGIN_API_CALL
bool is_valid(const plane_3d &p)
#define RS2_ENUM_HELPERS(TYPE, PREFIX)
GLFWAPI int glfwInit(void)
Initializes the GLFW library.
static std::shared_ptr< pointcloud > create()
#define HANDLE_EXCEPTIONS_AND_RETURN(R,...)
#define INITIALIZE_EASYLOGGINGPP
GLFWAPI void glfwSwapInterval(int interval)
Sets the swap interval for the current context.
GLFWAPI void glfwMakeContextCurrent(GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
void rs2_gl_init_processing(int api_version, int use_glsl, rs2_error **error) BEGIN_API_CALL
void rs2_gl_set_matrix(rs2_processing_block *block, rs2_gl_matrix_type type, float *m4x4, rs2_error **error) BEGIN_API_CALL
rs2_stream
Streams are different types of data provided by RealSense devices.
void rs2_gl_init_rendering_glfw(int api_version, glfw_binding bindings, int use_glsl, rs2_error **error) BEGIN_API_CALL
GLFWAPI GLFWwindow * glfwCreateWindow(int width, int height, const char *title, GLFWmonitor *monitor, GLFWwindow *share)
Creates a window and its associated context.
#define NOARGS_HANDLE_EXCEPTIONS_AND_RETURN(R)
#define VALIDATE_RANGE(ARG, MIN, MAX)
GLFWAPI void glfwDestroyWindow(GLFWwindow *window)
Destroys the specified window and its context.
static rendering_lane & instance()
void init(glfw_binding binding, bool use_glsl)
void rs2_gl_shutdown_rendering(int api_version, rs2_error **error) BEGIN_API_CALL
rs2_processing_block * rs2_gl_create_pointcloud(int api_version, rs2_error **error) BEGIN_API_CALL
static processing_lane & instance()
rs2_processing_block * rs2_gl_create_pointcloud_renderer(int api_version, rs2_error **error) BEGIN_API_CALL
int rs2_gl_is_frame_extendable_to(const rs2_frame *f, rs2_gl_extension extension_type, rs2_error **error) BEGIN_API_CALL
GLFWAPI GLFWwindow * glfwGetCurrentContext(void)
Returns the window whose context is current on the calling thread.
struct GLFWwindow GLFWwindow
GLFWAPI void glfwWindowHint(int hint, int value)
Sets the specified window hint to the desired value.
#define VALIDATE_NOT_NULL(ARG)
struct rs2_frame rs2_frame
#define VALIDATE_ENUM(ARG)
const char * rs2_gl_extension_to_string(rs2_gl_extension ex)
std::shared_ptr< gl::context > ctx