Exposes RealSense processing-block functionality for GPU for C compilers. More...
#include "librealsense2/rs.h"
Go to the source code of this file.
Classes | |
struct | glfw_binding |
Typedefs | |
typedef GLFWwindow *(* | glfwCreateWindowFun) (int, int, const char *, GLFWmonitor *, GLFWwindow *) |
typedef void(* | glfwDestroyWindowFun) (GLFWwindow *) |
typedef GLFWwindow *(* | glfwGetCurrentContextFun) (void) |
typedef GLFWglproc(* | glfwGetProcAddressFun) (const char *) |
typedef void(* | GLFWglproc) (void) |
typedef int(* | glfwInitFun) (void) |
typedef void(* | glfwMakeContextCurrentFun) (GLFWwindow *) |
typedef struct GLFWmonitor | GLFWmonitor |
typedef void(* | glfwSwapIntervalFun) (int) |
typedef struct GLFWwindow | GLFWwindow |
typedef void(* | glfwWindowHintFun) (int, int) |
typedef enum rs2_gl_extension | rs2_gl_extension |
typedef enum rs2_gl_matrix_type | rs2_gl_matrix_type |
Exposes RealSense processing-block functionality for GPU for C compilers.
Definition in file rs_processing_gl.h.
typedef GLFWwindow*(* glfwCreateWindowFun) (int, int, const char *, GLFWmonitor *, GLFWwindow *) |
Definition at line 47 of file rs_processing_gl.h.
typedef void(* glfwDestroyWindowFun) (GLFWwindow *) |
Definition at line 48 of file rs_processing_gl.h.
typedef GLFWwindow*(* glfwGetCurrentContextFun) (void) |
Definition at line 50 of file rs_processing_gl.h.
typedef GLFWglproc(* glfwGetProcAddressFun) (const char *) |
Definition at line 53 of file rs_processing_gl.h.
Definition at line 52 of file rs_processing_gl.h.
typedef int(* glfwInitFun) (void) |
Definition at line 45 of file rs_processing_gl.h.
typedef void(* glfwMakeContextCurrentFun) (GLFWwindow *) |
Definition at line 49 of file rs_processing_gl.h.
typedef struct GLFWmonitor GLFWmonitor |
Definition at line 44 of file rs_processing_gl.h.
typedef void(* glfwSwapIntervalFun) (int) |
Definition at line 51 of file rs_processing_gl.h.
typedef struct GLFWwindow GLFWwindow |
Definition at line 43 of file rs_processing_gl.h.
typedef void(* glfwWindowHintFun) (int, int) |
Definition at line 46 of file rs_processing_gl.h.
typedef enum rs2_gl_extension rs2_gl_extension |
typedef enum rs2_gl_matrix_type rs2_gl_matrix_type |
enum rs2_gl_extension |
Enumerator | |
---|---|
RS2_GL_EXTENSION_VIDEO_FRAME | |
RS2_GL_EXTENSION_COUNT |
Definition at line 22 of file rs_processing_gl.h.
enum rs2_gl_matrix_type |
Enumerator | |
---|---|
RS2_GL_MATRIX_TRANSFORMATION | |
RS2_GL_MATRIX_PROJECTION | |
RS2_GL_MATRIX_CAMERA | |
RS2_GL_MATRIX_COUNT |
Definition at line 33 of file rs_processing_gl.h.
rs2_processing_block* rs2_gl_create_align | ( | int | api_version, |
rs2_stream | to, | ||
rs2_error ** | error | ||
) |
Creates Align processing block This block has similar capabilities as the regular librealsense align
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[in] | align_to | stream type to be used as the target of frameset alignment |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 134 of file src/gl/rs-gl.cpp.
rs2_processing_block* rs2_gl_create_camera_renderer | ( | int | api_version, |
rs2_error ** | error | ||
) |
Camera renderer is a rendering block (meaning it has to be called within the main OpenGL rendering context) that will render the camera model of the frame provided to it
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 232 of file src/gl/rs-gl.cpp.
rs2_processing_block* rs2_gl_create_colorizer | ( | int | api_version, |
rs2_error ** | error | ||
) |
Creates Colorizer processing block This block has similar capabilities as the regular librealsense colorizer It is capable of applying depth to RGB conversion using various color schemes and optional histogram equalization
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 122 of file src/gl/rs-gl.cpp.
rs2_processing_block* rs2_gl_create_pointcloud | ( | int | api_version, |
rs2_error ** | error | ||
) |
Creates Point-Cloud processing block. This block accepts depth frames and outputs Points frames In addition, given non-depth frame, the block will align texture coordinate to the non-depth stream
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 146 of file src/gl/rs-gl.cpp.
rs2_processing_block* rs2_gl_create_pointcloud_renderer | ( | int | api_version, |
rs2_error ** | error | ||
) |
Pointcloud renderer will render texture pointcloud as either points or connected polygons
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 248 of file src/gl/rs-gl.cpp.
rs2_processing_block* rs2_gl_create_uploader | ( | int | api_version, |
rs2_error ** | error | ||
) |
Creates Upload processing block This object can explicitly copy frames from the CPU to the GPU This allows pre-emptively upload frame to the GPU on a background thread To be used directly in future GPU processing
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 240 of file src/gl/rs-gl.cpp.
rs2_processing_block* rs2_gl_create_yuy_decoder | ( | int | api_version, |
rs2_error ** | error | ||
) |
Creates a processing block that can efficiently convert YUY image format to RGB variants This is specifically useful for rendering the RGB frame to the screen (since the output is ready for rendering on the GPU)
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 69 of file src/gl/rs-gl.cpp.
const char* rs2_gl_extension_to_string | ( | rs2_extension | type | ) |
unsigned int rs2_gl_frame_get_texture_id | ( | const rs2_frame * | f, |
unsigned int | id, | ||
rs2_error ** | error | ||
) |
Assuming frame is extendable to RS2_GL_EXTENSION_VIDEO_FRAME, this method will fetch one of frames texture IDs Each GPU frame can hold one or more OpenGL textures
[in] | f | Frame pointer |
[in] | id | Index of texture within the frame |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 82 of file src/gl/rs-gl.cpp.
Initialize processing pipeline. This function allows GL processing blocks to run on the GPU. Until initialized, all GL processing blocks will fall back to their CPU versions. When initializing using this method, texture sharing is not available.
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 193 of file src/gl/rs-gl.cpp.
void rs2_gl_init_processing_glfw | ( | int | api_version, |
GLFWwindow * | share_with, | ||
glfw_binding | bindings, | ||
int | use_glsl, | ||
rs2_error ** | error | ||
) |
In order to share GL processing results with GLFW rendering application the user need to initialize rendering by passing GLFW binding information C++ wrapper will automatically generate and pass this data
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[in] | share_with | Pointer to GLFW window object. This window will be able to use texture IDs provided inside GPU-frames generated by the library |
[in] | bindings | Pointers to GLFW methods that will be used by the library |
[in] | use_glsl | Use GLSL shaders for processing |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 210 of file src/gl/rs-gl.cpp.
Initialize rendering pipeline. This function must be called before executing any of the rendering blocks. Rendering blocks do not handle threading, and assume all calls (including init / shutdown) Until initialized, rendering blocks will do nothing (function as bypass filters) are serialized and coming from a single rendering thread
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[in] | use_glsl | On modern GPUs you can get slightly better performance using GLSL However, this assumes the current rendering context is v3+ Setting use_glsl to false will use legacy OpenGL calls This in turn assumes the rendering context is either version < 3, or is a compatibility context |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 169 of file src/gl/rs-gl.cpp.
void rs2_gl_init_rendering_glfw | ( | int | api_version, |
glfw_binding | bindings, | ||
int | use_glsl, | ||
rs2_error ** | error | ||
) |
In order to use GL rendering with GLFW application the user need to initialize rendering by passing GLFW binding information C++ wrapper will automatically generate and pass this data
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[in] | bindings | Pointers to GLFW methods that will be used by the library |
[in] | use_glsl | Use GLSL shaders for rendering |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 186 of file src/gl/rs-gl.cpp.
int rs2_gl_is_frame_extendable_to | ( | const rs2_frame * | f, |
rs2_gl_extension | extension_type, | ||
rs2_error ** | error | ||
) |
Query if frame is extendable to one of the GL-specific extensions
[in] | f | Frame pointer |
[in] | extension_type | Extension type |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 98 of file src/gl/rs-gl.cpp.
const char* rs2_gl_matrix_type_to_string | ( | rs2_gl_matrix_type | type | ) |
Definition at line 67 of file src/gl/rs-gl.cpp.
void rs2_gl_set_matrix | ( | rs2_processing_block * | block, |
rs2_gl_matrix_type | type, | ||
float * | m4x4, | ||
rs2_error ** | error | ||
) |
Sets new value to one of processing blocks matrices
[in] | block | Processing block object |
[in] | type | Matrix type |
[in] | m4x4 | Pointer to 16 floating point values encoding 4x4 matrix |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 158 of file src/gl/rs-gl.cpp.
Shutdown librealsense processing. This will switch all GL processing blocks into CPU only mode
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 225 of file src/gl/rs-gl.cpp.
Shutdown librealsense rendering. This will disable all rendering blocks
[in] | api_version | Users are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version. |
[out] | error | if non-null, receives any error that occurs during this call, otherwise, errors are ignored |
Definition at line 218 of file src/gl/rs-gl.cpp.