Intel® RealSense™ Cross Platform API
Intel Realsense Cross-platform API
|
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 enum rs2_gl_extension | rs2_gl_extension |
typedef enum rs2_gl_matrix_type | rs2_gl_matrix_type |
typedef struct GLFWwindow | GLFWwindow |
typedef struct GLFWmonitor | GLFWmonitor |
typedef int(* | glfwInitFun) (void) |
typedef void(* | glfwWindowHintFun) (int, int) |
typedef GLFWwindow *(* | glfwCreateWindowFun) (int, int, const char *, GLFWmonitor *, GLFWwindow *) |
typedef void(* | glfwDestroyWindowFun) (GLFWwindow *) |
typedef void(* | glfwMakeContextCurrentFun) (GLFWwindow *) |
typedef GLFWwindow *(* | glfwGetCurrentContextFun) (void) |
typedef void(* | glfwSwapIntervalFun) (int) |
typedef void(* | GLFWglproc) (void) |
typedef GLFWglproc(* | glfwGetProcAddressFun) (const char *) |
Exposes RealSense processing-block functionality for GPU for C compilers.
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 |
enum rs2_gl_extension |
enum rs2_gl_matrix_type |
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 |
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 |
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 |
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 |
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 |
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 |
rs2_processing_block* rs2_gl_create_y411_decoder | ( | int | api_version, |
rs2_error ** | error | ||
) |
Creates y411 decoder processing block. This block accepts raw y411 frames and outputs frames in RGB8. https://www.fourcc.org/pixel-format/yuv-y411/ Y411 is disguised as NV12 to allow Linux compatibility. Both are 12bpp encodings that allow high-resolution modes in the camera to still fit within the USB3 limits (YUY wasn't enough).
[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 |
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 |
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 |
void rs2_gl_init_processing | ( | int | api_version, |
int | use_glsl, | ||
rs2_error ** | error | ||
) |
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 |
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 |
void rs2_gl_init_rendering | ( | int | api_version, |
int | use_glsl, | ||
rs2_error ** | error | ||
) |
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 |
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 |
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 |
const char* rs2_gl_matrix_type_to_string | ( | rs2_gl_matrix_type | type | ) |
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 |
void rs2_gl_shutdown_processing | ( | int | api_version, |
rs2_error ** | error | ||
) |
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 |
void rs2_gl_shutdown_rendering | ( | int | api_version, |
rs2_error ** | error | ||
) |
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 |