Classes | Typedefs | Enumerations | Functions
rs_processing_gl.h File Reference

Exposes RealSense processing-block functionality for GPU for C compilers. More...

#include "librealsense2/rs.h"
Include dependency graph for rs_processing_gl.h:
This graph shows which files directly or indirectly include this file:

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
 

Enumerations

enum  rs2_gl_extension { RS2_GL_EXTENSION_VIDEO_FRAME, RS2_GL_EXTENSION_COUNT }
 
enum  rs2_gl_matrix_type { RS2_GL_MATRIX_TRANSFORMATION, RS2_GL_MATRIX_PROJECTION, RS2_GL_MATRIX_CAMERA, RS2_GL_MATRIX_COUNT }
 

Functions

rs2_processing_blockrs2_gl_create_align (int api_version, rs2_stream to, rs2_error **error)
 
rs2_processing_blockrs2_gl_create_camera_renderer (int api_version, rs2_error **error)
 
rs2_processing_blockrs2_gl_create_colorizer (int api_version, rs2_error **error)
 
rs2_processing_blockrs2_gl_create_pointcloud (int api_version, rs2_error **error)
 
rs2_processing_blockrs2_gl_create_pointcloud_renderer (int api_version, rs2_error **error)
 
rs2_processing_blockrs2_gl_create_uploader (int api_version, rs2_error **error)
 
rs2_processing_blockrs2_gl_create_yuy_decoder (int api_version, rs2_error **error)
 
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)
 
void rs2_gl_init_processing (int api_version, int use_glsl, rs2_error **error)
 
void rs2_gl_init_processing_glfw (int api_version, GLFWwindow *share_with, glfw_binding bindings, int use_glsl, rs2_error **error)
 
void rs2_gl_init_rendering (int api_version, int use_glsl, rs2_error **error)
 
void rs2_gl_init_rendering_glfw (int api_version, glfw_binding bindings, int use_glsl, rs2_error **error)
 
int rs2_gl_is_frame_extendable_to (const rs2_frame *f, rs2_gl_extension extension_type, rs2_error **error)
 
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)
 
void rs2_gl_shutdown_processing (int api_version, rs2_error **error)
 
void rs2_gl_shutdown_rendering (int api_version, rs2_error **error)
 

Detailed Description

Exposes RealSense processing-block functionality for GPU for C compilers.

Definition in file rs_processing_gl.h.

Typedef Documentation

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.

typedef void(* GLFWglproc) (void)

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.

Enumeration Type Documentation

Enumerator
RS2_GL_EXTENSION_VIDEO_FRAME 
RS2_GL_EXTENSION_COUNT 

Definition at line 22 of file rs_processing_gl.h.

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.

Function Documentation

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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[in]align_tostream type to be used as the target of frameset alignment
[out]errorif 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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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)

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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

Parameters
[in]fFrame pointer
[in]idIndex of texture within the frame
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
OpenGL texture

Definition at line 82 of file src/gl/rs-gl.cpp.

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.

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[in]share_withPointer to GLFW window object. This window will be able to use texture IDs provided inside GPU-frames generated by the library
[in]bindingsPointers to GLFW methods that will be used by the library
[in]use_glslUse GLSL shaders for processing
[out]errorif 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.

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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[in]use_glslOn 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]errorif 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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[in]bindingsPointers to GLFW methods that will be used by the library
[in]use_glslUse GLSL shaders for rendering
[out]errorif 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

Parameters
[in]fFrame pointer
[in]extension_typeExtension type
[out]errorif non-null, receives any error that occurs during this call, otherwise, errors are ignored
Returns
1 if true, 0 otherwise

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

Parameters
[in]blockProcessing block object
[in]typeMatrix type
[in]m4x4Pointer to 16 floating point values encoding 4x4 matrix
[out]errorif 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.

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

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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.

void rs2_gl_shutdown_rendering ( int  api_version,
rs2_error **  error 
)

Shutdown librealsense rendering. This will disable all rendering blocks

Parameters
[in]api_versionUsers are expected to pass their version of RS2_API_VERSION to make sure they are running the correct librealsense version.
[out]errorif 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.



librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:29