Classes | Namespaces | Functions
src/gl/rs-gl.cpp File Reference
#include "api.h"
#include "synthetic-stream-gl.h"
#include "yuy2rgb-gl.h"
#include "align-gl.h"
#include "pointcloud-gl.h"
#include "../include/librealsense2/h/rs_types.h"
#include "../include/librealsense2-gl/rs_processing_gl.h"
#include "camera-shader.h"
#include "upload.h"
#include "pc-shader.h"
#include "colorizer-gl.h"
#include "proc/color-formats-converter.h"
#include "proc/colorizer.h"
#include "proc/align.h"
#include "log.h"
#include <assert.h>
#include <GLFW/glfw3.h>
Include dependency graph for src/gl/rs-gl.cpp:

Go to the source code of this file.

Classes

struct  rs2_gl_context
 

Namespaces

 librealsense
 

Functions

const char * librealsense::get_string (rs2_gl_extension value)
 
const char * librealsense::get_string (rs2_gl_matrix_type value)
 
rs2_processing_blockrs2_gl_create_align (int api_version, rs2_stream to, rs2_error **error) BEGIN_API_CALL
 
rs2_processing_blockrs2_gl_create_camera_renderer (int api_version, rs2_error **error) BEGIN_API_CALL
 
rs2_processing_blockrs2_gl_create_colorizer (int api_version, rs2_error **error) BEGIN_API_CALL
 
rs2_processing_blockrs2_gl_create_pointcloud (int api_version, rs2_error **error) BEGIN_API_CALL
 
rs2_processing_blockrs2_gl_create_pointcloud_renderer (int api_version, rs2_error **error) BEGIN_API_CALL
 
rs2_processing_blockrs2_gl_create_uploader (int api_version, rs2_error **error) BEGIN_API_CALL
 
rs2_processing_blockrs2_gl_create_yuy_decoder (int api_version, rs2_error **error) BEGIN_API_CALL
 
const char * rs2_gl_extension_to_string (rs2_gl_extension ex)
 
unsigned int rs2_gl_frame_get_texture_id (const rs2_frame *frame_ref, unsigned int id, rs2_error **error) BEGIN_API_CALL
 
void rs2_gl_init_processing (int api_version, int use_glsl, rs2_error **error) BEGIN_API_CALL
 
void rs2_gl_init_processing_glfw (int api_version, GLFWwindow *share_with, glfw_binding bindings, int use_glsl, rs2_error **error) BEGIN_API_CALL
 
void rs2_gl_init_rendering (int api_version, int use_glsl, rs2_error **error) BEGIN_API_CALL
 
void rs2_gl_init_rendering_glfw (int api_version, glfw_binding bindings, int use_glsl, 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
 
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) BEGIN_API_CALL
 
void rs2_gl_shutdown_processing (int api_version, rs2_error **error) BEGIN_API_CALL
 
void rs2_gl_shutdown_rendering (int api_version, rs2_error **error) BEGIN_API_CALL
 

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_gl_extension  ex)

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

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:28