camera-shader.h
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3 
4 #pragma once
5 
6 #include "opengl3.h"
7 #include "synthetic-stream-gl.h"
9 
10 namespace librealsense
11 {
12  namespace gl
13  {
15  {
16  public:
17  camera_shader();
18 
19  void begin();
20  void end();
21 
22  void set_mvp(const rs2::matrix4& model,
23  const rs2::matrix4& view,
24  const rs2::matrix4& projection);
25 
26  void set_opacity(float opacity);
27  protected:
28  std::unique_ptr<rs2::shader_program> _shader;
29 
30  private:
31  void init();
32 
37  };
38 
40  public gpu_rendering_object,
41  public matrix_container
42  {
43  public:
45  ~camera_renderer() override;
46 
47  void cleanup_gpu_resources() override;
48  void create_gpu_resources() override;
49 
51 
52  private:
53  std::vector<rs2::obj_mesh> camera_mesh;
54  std::shared_ptr<camera_shader> _shader;
55  std::vector<std::unique_ptr<rs2::vao>> _camera_model;
56 
58  };
59 
60  }
61 }
librealsense
Definition: algo.h:18
librealsense::gl::camera_renderer::_opacity_opt
option * _opacity_opt
Definition: camera-shader.h:57
librealsense::gl::camera_renderer::create_gpu_resources
void create_gpu_resources() override
Definition: camera-shader.cpp:90
rs2::frame
Definition: rs_frame.hpp:345
opengl3.h
rs2::frame_source
Definition: rs_processing.hpp:18
librealsense::gl::camera_shader::_transformation_matrix_location
uint32_t _transformation_matrix_location
Definition: camera-shader.h:33
librealsense::gl::camera_renderer::~camera_renderer
~camera_renderer() override
Definition: camera-shader.cpp:103
librealsense::gl::camera_shader::camera_shader
camera_shader()
Definition: camera-shader.cpp:48
librealsense::gl::camera_shader::begin
void begin()
Definition: camera-shader.cpp:67
synthetic-stream-gl.h
librealsense::gl::gpu_rendering_object
Definition: synthetic-stream-gl.h:265
librealsense::gl::camera_renderer::process_frame
rs2::frame process_frame(const rs2::frame_source &source, const rs2::frame &f) override
Definition: camera-shader.cpp:155
librealsense::gl::camera_shader::_shader
std::unique_ptr< rs2::shader_program > _shader
Definition: camera-shader.h:28
librealsense::gl::camera_renderer::_shader
std::shared_ptr< camera_shader > _shader
Definition: camera-shader.h:54
librealsense::stream_filter_processing_block
Definition: synthetic-stream.h:134
uint32_t
unsigned int uint32_t
Definition: stdint.h:80
librealsense::gl::camera_renderer::cleanup_gpu_resources
void cleanup_gpu_resources() override
Definition: camera-shader.cpp:84
f
GLdouble f
Definition: glad/glad/glad.h:1517
synthetic-stream.h
librealsense::gl::camera_renderer::_camera_model
std::vector< std::unique_ptr< rs2::vao > > _camera_model
Definition: camera-shader.h:55
librealsense::gl::camera_shader::set_opacity
void set_opacity(float opacity)
Definition: camera-shader.cpp:79
opencv_pointcloud_viewer.view
def view(v)
Definition: opencv_pointcloud_viewer.py:168
librealsense::gl::camera_shader::_projection_matrix_location
uint32_t _projection_matrix_location
Definition: camera-shader.h:34
librealsense::gl::camera_shader::init
void init()
Definition: camera-shader.cpp:57
source
GLsizei GLsizei GLchar * source
Definition: glad/glad/glad.h:2828
test-unit-transform.model
model
Definition: test-unit-transform.py:27
librealsense::gl::camera_shader::_camera_matrix_location
uint32_t _camera_matrix_location
Definition: camera-shader.h:35
librealsense::gl::matrix_container
Definition: synthetic-stream-gl.h:192
librealsense::option
Definition: option-interface.h:22
librealsense::gl::camera_renderer
Definition: camera-shader.h:39
rs2::matrix4
Definition: matrix4.h:16
librealsense::gl::camera_shader::end
void end()
Definition: camera-shader.cpp:68
librealsense::gl::camera_renderer::camera_renderer
camera_renderer()
Definition: camera-shader.cpp:124
librealsense::gl::camera_shader::set_mvp
void set_mvp(const rs2::matrix4 &model, const rs2::matrix4 &view, const rs2::matrix4 &projection)
Definition: camera-shader.cpp:70
librealsense::gl::camera_shader::_opacity_location
uint32_t _opacity_location
Definition: camera-shader.h:36
librealsense::gl::camera_renderer::camera_mesh
std::vector< rs2::obj_mesh > camera_mesh
Definition: camera-shader.h:53
librealsense::gl::camera_shader
Definition: camera-shader.h:14


librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Fri Aug 2 2024 08:30:01