Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
rs_processing_gl.h
Go to the documentation of this file.
1 /* License: Apache 2.0. See LICENSE file in root directory.
2  Copyright(c) 2017 Intel Corporation. All Rights Reserved. */
3 
9 #ifndef LIBREALSENSE_RS2_PROCESSING_GL_H
10 #define LIBREALSENSE_RS2_PROCESSING_GL_H
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include "librealsense2/rs.h"
17 
18 /*
19 * GL-specific extension types.
20 * Used similar to regular RS extensions
21 */
22 typedef enum rs2_gl_extension
23 {
28 
29 /*
30 * In addition to "options", GL processing blocks
31 * expose new type of multidementional options each holding a 4x4 matrix
32 */
33 typedef enum rs2_gl_matrix_type
34 {
41 
42 /* Forward-declare GLFW types */
43 typedef struct GLFWwindow GLFWwindow;
44 typedef struct GLFWmonitor GLFWmonitor;
45 typedef int(*glfwInitFun)(void);
46 typedef void(*glfwWindowHintFun)(int, int);
47 typedef GLFWwindow*(*glfwCreateWindowFun)(int, int, const char*, GLFWmonitor*, GLFWwindow*);
50 typedef GLFWwindow*(*glfwGetCurrentContextFun)(void);
51 typedef void(*glfwSwapIntervalFun)(int);
52 typedef void(*GLFWglproc)(void);
53 typedef GLFWglproc(*glfwGetProcAddressFun)(const char*);
54 
55 /* To avoid GLFW version mismatch (mainly can affect Windows), the application passes pointers
56 * to its version of GLFW, via glfw_bindings struct
57 */
59 {
68 };
69 
77 
88 
96 void rs2_gl_set_matrix(rs2_processing_block* block, rs2_gl_matrix_type type, float* m4x4, rs2_error** error);
97 
105 int rs2_gl_is_frame_extendable_to(const rs2_frame* f, rs2_gl_extension extension_type, rs2_error** error);
106 
116 unsigned int rs2_gl_frame_get_texture_id(const rs2_frame* f, unsigned int id, rs2_error** error);
117 
125 
133 
140 rs2_processing_block* rs2_gl_create_pointcloud(int api_version, rs2_error** error);
141 
150 rs2_processing_block* rs2_gl_create_uploader(int api_version, rs2_error** error);
151 
160 rs2_processing_block* rs2_gl_create_colorizer(int api_version, rs2_error** error);
161 
169 rs2_processing_block* rs2_gl_create_align(int api_version, rs2_stream to, rs2_error** error);
170 
184 void rs2_gl_init_rendering(int api_version, int use_glsl, rs2_error** error);
185 
195 void rs2_gl_init_rendering_glfw(int api_version, glfw_binding bindings, int use_glsl, rs2_error** error);
196 
205 void rs2_gl_init_processing(int api_version, int use_glsl, rs2_error** error);
206 
217 void rs2_gl_init_processing_glfw(int api_version, GLFWwindow* share_with,
218  glfw_binding bindings, int use_glsl, rs2_error** error);
219 
225 void rs2_gl_shutdown_rendering(int api_version, rs2_error** error);
226 
232 void rs2_gl_shutdown_processing(int api_version, rs2_error** error);
233 
234 #ifdef __cplusplus
235 }
236 #endif
237 #endif
rs2_processing_block * rs2_gl_create_colorizer(int api_version, rs2_error **error)
void rs2_gl_shutdown_processing(int api_version, rs2_error **error)
glfwCreateWindowFun glfwCreateWindow
Definition: rs_processing_gl.h:62
glfwMakeContextCurrentFun glfwMakeContextCurrent
Definition: rs_processing_gl.h:64
glfwDestroyWindowFun glfwDestroyWindow
Definition: rs_processing_gl.h:63
glfwGetProcAddressFun glfwGetProcAddress
Definition: rs_processing_gl.h:67
void rs2_gl_init_rendering_glfw(int api_version, glfw_binding bindings, int use_glsl, rs2_error **error)
rs2_processing_block * rs2_gl_create_pointcloud_renderer(int api_version, rs2_error **error)
struct GLFWmonitor GLFWmonitor
Definition: rs_processing_gl.h:44
void rs2_gl_shutdown_rendering(int api_version, rs2_error **error)
Definition: rs_processing_gl.h:58
const char * rs2_gl_matrix_type_to_string(rs2_gl_matrix_type type)
int rs2_gl_is_frame_extendable_to(const rs2_frame *f, rs2_gl_extension extension_type, rs2_error **error)
rs2_processing_block * rs2_gl_create_yuy_decoder(int api_version, rs2_error **error)
Exposes librealsense functionality for C compilers.
glfwInitFun glfwInit
Definition: rs_processing_gl.h:60
void(* GLFWglproc)(void)
Definition: rs_processing_gl.h:52
void rs2_gl_set_matrix(rs2_processing_block *block, rs2_gl_matrix_type type, float *m4x4, rs2_error **error)
GLFWglproc(* glfwGetProcAddressFun)(const char *)
Definition: rs_processing_gl.h:53
void(* glfwMakeContextCurrentFun)(GLFWwindow *)
Definition: rs_processing_gl.h:49
Definition: rs_processing_gl.h:35
const char * rs2_gl_extension_to_string(rs2_extension type)
Definition: rs_processing_gl.h:25
void(* glfwSwapIntervalFun)(int)
Definition: rs_processing_gl.h:51
Definition: rs_processing_gl.h:36
GLFWwindow *(* glfwGetCurrentContextFun)(void)
Definition: rs_processing_gl.h:50
Definition: rs_processing_gl.h:24
void(* glfwWindowHintFun)(int, int)
Definition: rs_processing_gl.h:46
glfwSwapIntervalFun glfwSwapInterval
Definition: rs_processing_gl.h:66
rs2_stream
Streams are different types of data provided by RealSense devices.
Definition: rs_sensor.h:43
void rs2_gl_init_processing_glfw(int api_version, GLFWwindow *share_with, glfw_binding bindings, int use_glsl, rs2_error **error)
rs2_gl_extension
Definition: rs_processing_gl.h:22
rs2_processing_block * rs2_gl_create_camera_renderer(int api_version, rs2_error **error)
void rs2_gl_init_rendering(int api_version, int use_glsl, rs2_error **error)
struct rs2_processing_block rs2_processing_block
Definition: rs_types.h:246
rs2_processing_block * rs2_gl_create_uploader(int api_version, rs2_error **error)
rs2_extension
Specifies advanced interfaces (capabilities) objects may implement.
Definition: rs_types.h:136
rs2_processing_block * rs2_gl_create_y411_decoder(int api_version, rs2_error **error)
void(* glfwDestroyWindowFun)(GLFWwindow *)
Definition: rs_processing_gl.h:48
glfwGetCurrentContextFun glfwGetCurrentContext
Definition: rs_processing_gl.h:65
rs2_processing_block * rs2_gl_create_align(int api_version, rs2_stream to, rs2_error **error)
rs2_gl_matrix_type
Definition: rs_processing_gl.h:33
unsigned int rs2_gl_frame_get_texture_id(const rs2_frame *f, unsigned int id, rs2_error **error)
glfwWindowHintFun glfwWindowHint
Definition: rs_processing_gl.h:61
Definition: rs_processing_gl.h:37
int(* glfwInitFun)(void)
Definition: rs_processing_gl.h:45
struct rs2_error rs2_error
Definition: rs_types.h:229
rs2_processing_block * rs2_gl_create_pointcloud(int api_version, rs2_error **error)
GLFWwindow *(* glfwCreateWindowFun)(int, int, const char *, GLFWmonitor *, GLFWwindow *)
Definition: rs_processing_gl.h:47
Definition: rs_processing_gl.h:38
struct GLFWwindow GLFWwindow
Definition: rs_processing_gl.h:43
struct rs2_frame rs2_frame
Definition: rs_types.h:232
void rs2_gl_init_processing(int api_version, int use_glsl, rs2_error **error)