pointcloud-gl.cpp
Go to the documentation of this file.
1 // License: Apache 2.0. See LICENSE file in root directory.
2 // Copyright(c) 2017 Intel Corporation. All Rights Reserved.
3 
4 #include "../include/librealsense2/rs.hpp"
5 #include "../include/librealsense2/rsutil.h"
6 
7 #include "synthetic-stream-gl.h"
8 #include "environment.h"
10 #include "pointcloud-gl.h"
11 #include "option.h"
12 #include "environment.h"
13 #include "context.h"
14 
15 #include <iostream>
16 #include <chrono>
17 
18 #include "opengl3.h"
19 
20 using namespace rs2;
21 using namespace librealsense;
22 using namespace librealsense::gl;
23 
24 static const char* project_fragment_text =
25 "#version 130\n"
26 "in vec2 textCoords;\n"
27 "out vec4 output_xyz;\n"
28 "out vec4 output_uv;\n"
29 "uniform sampler2D textureSampler;\n"
30 "uniform float opacity;\n"
31 "uniform mat4 extrinsics;\n"
32 ""
33 "uniform vec2 focal1;\n"
34 "uniform vec2 principal1;\n"
35 "uniform float is_bc1;\n"
36 "uniform float coeffs1[5];\n"
37 ""
38 "uniform vec2 focal2;\n"
39 "uniform vec2 principal2;\n"
40 "uniform float is_bc2;\n"
41 "uniform float coeffs2[5];\n"
42 ""
43 "uniform float depth_scale;\n"
44 "uniform float width1;\n"
45 "uniform float height1;\n"
46 "uniform float width2;\n"
47 "uniform float height2;\n"
48 "\n"
49 "uniform float needs_projection;\n"
50 "\n"
51 "void main(void) {\n"
52 " float px = textCoords.x * width1;\n"
53 " float py = (1.0 - textCoords.y) * height1;\n"
54 " float x = (px - principal1.x) / focal1.x;\n"
55 " float y = (py - principal1.y) / focal1.y;\n"
56 " float xo = x;\n"
57 " float yo = y;\n"
58 " if(is_bc1 == 2.0)\n"
59 " {\n"
60 " for (int i = 0; i < 10; i++)\n"
61 " {\n"
62 " float r2 = x * x + y * y;\n"
63 " float icdist = 1.0 / (1.0 + ((coeffs1[4] * r2 + coeffs1[1])*r2 + coeffs1[0])*r2);\n"
64 " float xq = x / icdist;\n"
65 " float yq = y / icdist;\n"
66 " float delta_x = 2 * coeffs1[2] * xq*yq + coeffs1[3] * (r2 + 2 * xq*xq);\n"
67 " float delta_y = 2 * coeffs1[3] * xq*yq + coeffs1[2] * (r2 + 2 * yq*yq);\n"
68 " x = (xo - delta_x)*icdist;\n"
69 " y = (yo - delta_y)*icdist;\n"
70 " }\n"
71 " }\n"
72 " if (is_bc1 == 4.0)\n"
73 " {\n"
74 " for (int i = 0; i < 10; i++)\n"
75 " {\n"
76 " float r2 = x * x + y * y;\n"
77 " float icdist = 1.0 / (1.0 + ((coeffs1[4] * r2 + coeffs1[1])*r2 + coeffs1[0])*r2);\n"
78 " float delta_x = 2 * coeffs1[2] * x*y + coeffs1[3] * (r2 + 2 * x*x);\n"
79 " float delta_y = 2 * coeffs1[3] * x*y + coeffs1[2] * (r2 + 2 * y*y);\n"
80 " x = (xo - delta_x)*icdist;\n"
81 " y = (yo - delta_y)*icdist;\n"
82 " }\n"
83 " }\n"
84 " vec2 tex = vec2(textCoords.x, 1.0 - textCoords.y);\n"
85 " vec4 dp = texture(textureSampler, tex);\n"
86 " float nd = (dp.x + dp.y * 256.0) * 256.0;\n"
87 " float depth = depth_scale * nd;\n"
88 " vec4 xyz = vec4(x * depth, y * depth, depth, 1.0);\n"
89 " output_xyz = xyz;\n"
90 ""
91 " if (needs_projection > 0) {"
92 " vec4 trans = extrinsics * xyz;\n"
93 " x = trans.x / trans.z;\n"
94 " y = trans.y / trans.z;\n"
95 "\n"
96 " if(is_bc2 == 2.0)\n"
97 " {\n"
98 " float r2 = x*x + y*y;\n"
99 " float f = 1.0 + coeffs2[0]*r2 + coeffs2[1]*r2*r2 + coeffs2[4]*r2*r2*r2;\n"
100 " x *= f;\n"
101 " y *= f;\n"
102 " float dx = x + 2.0*coeffs2[2]*x*y + coeffs2[3]*(r2 + 2.0*x*x);\n"
103 " float dy = y + 2.0*coeffs2[3]*x*y + coeffs2[2]*(r2 + 2.0*y*y);\n"
104 " x = dx;\n"
105 " y = dy;\n"
106 " }\n"
107 " if (is_bc2 == 4.0)\n"
108 " {\n"
109 " float r2 = x * x + y * y;\n"
110 " float f = 1 + coeffs2[0] * r2 + coeffs2[1] * r2*r2 + coeffs2[4] * r2*r2*r2;\n"
111 " float xf = x * f;\n"
112 " float yf = y * f;\n"
113 " float dx = xf + 2 * coeffs2[2] * x*y + coeffs2[3] * (r2 + 2 * x*x);\n"
114 " float dy = yf + 2 * coeffs2[3] * x*y + coeffs2[2] * (r2 + 2 * y*y);\n"
115 " x = dx;\n"
116 " y = dy;\n"
117 " }\n"
118 " // TODO: Enable F-Thetha\n"
119 " //if (intrin->model == RS2_DISTORTION_FTHETA)\n"
120 " //{\n"
121 " // float r = sqrtf(x*x + y*y);\n"
122 " // float rd = (float)(1.0f / intrin->coeffs[0] * atan(2 * r* tan(intrin->coeffs[0] / 2.0f)));\n"
123 " // x *= rd / r;\n"
124 " // y *= rd / r;\n"
125 " //}\n"
126 "\n"
127 " float u = (x * focal2.x + principal2.x) / width2;\n"
128 " float v = (y * focal2.y + principal2.y) / height2;\n"
129 " output_uv = vec4(u, v, 0.0, 1.0);\n"
130 " } else {\n"
131 " output_uv = vec4(textCoords.x, 1.0 - textCoords.y, 0.0, 1.0);\n"
132 " }\n"
133 "}";
134 
135 static const char* occulution_vertex_shader_text =
136 "#version 130\n"
137 "attribute vec3 position;\n"
138 "attribute vec2 textureCoords;\n"
139 "varying vec2 textCoords;\n"
140 "varying vec2 occuTextureCoords[10];\n"
141 "uniform vec2 elementPosition;\n"
142 "uniform vec2 elementScale;\n"
143 "uniform float width;\n"
144 "uniform float height;\n"
145 "uniform int vscan;\n"
146 "void main(void)\n"
147 "{\n"
148 " gl_Position = vec4(position * vec3(elementScale, 1.0) + vec3(elementPosition, 0.0), 1.0);\n"
149 " textCoords = textureCoords;\n"
150 " float pixelsize = 1.0 / width;\n"
151 " float shift = 0.0;\n"
152 " for (int i = 0; i < 10; i++)\n"
153 " {\n"
154 " if(vscan > 0)\n"
155 " {\n"
156 " occuTextureCoords[i] = textureCoords + vec2(0.0, shift);\n"
157 " pixelsize = 2.0 / height;\n"
158 " } else {\n"
159 " occuTextureCoords[i] = textureCoords - vec2(shift, 0.0);\n"
160 " pixelsize = 2.0 / width;\n"
161 " }\n"
162 " shift += pixelsize;\n"
163 " }\n"
164 "}";
165 
166 static const char* occulution_fragment_text =
167 "#version 130\n"
168 "varying vec2 textCoords;\n"
169 "varying vec2 occuTextureCoords[10];\n"
170 "out vec4 texture_xyz;\n"
171 "out vec4 texture_uv;\n"
172 "uniform sampler2D xyzSampler;\n"
173 "uniform sampler2D uvSampler;\n"
174 "uniform float opacity;\n"
175 "uniform int vscan;\n"
176 "void main(void) {\n"
177 " vec4 xyz[10];\n"
178 " vec4 uv[10];\n"
179 " float uvmax = 0.0;\n"
180 " if(vscan > 0)\n"
181 " {\n"
182 " for (int i = 0; i < 10; i++)\n"
183 " {\n"
184 " vec2 tex = vec2(occuTextureCoords[i].x, 1.0 - occuTextureCoords[i].y);\n"
185 " xyz[i] = texture2D(xyzSampler, tex);\n"
186 " uv[i] = texture2D(uvSampler, tex);\n"
187 " if (uv[i].y > uvmax && xyz[i].z > 0.0)\n"
188 " {\n"
189 " uvmax = uv[i].y;\n"
190 " }\n"
191 " }\n"
192 " if (xyz[0].z > 0.0)\n"
193 " {\n"
194 " if (uv[0].y < uvmax)\n"
195 " {\n"
196 " texture_xyz = vec4(0.0, 0.0, 0.0, 1.0);\n"
197 " texture_uv = vec4(0.0, 0.0, 0.0, 1.0);\n"
198 " } else {\n"
199 " texture_xyz = xyz[0];\n"
200 " texture_uv = uv[0];\n"
201 " }\n"
202 " }\n"
203 " else {\n"
204 " texture_xyz = xyz[0];\n"
205 " texture_uv = uv[0];\n"
206 " }\n"
207 " } else {\n"
208 " for (int i = 0; i < 10; i++)\n"
209 " {\n"
210 " vec2 tex = vec2(occuTextureCoords[i].x, 1.0 - occuTextureCoords[i].y);\n"
211 " xyz[i] = texture2D(xyzSampler, tex);\n"
212 " uv[i] = texture2D(uvSampler, tex);\n"
213 " if (uv[i].x > uvmax && xyz[i].z > 0.0)\n"
214 " {\n"
215 " uvmax = uv[i].x;\n"
216 " }\n"
217 " }\n"
218 " if (xyz[0].z > 0.0)\n"
219 " {\n"
220 " if (uv[0].x < uvmax)\n"
221 " {\n"
222 " texture_xyz = vec4(0.0, 0.0, 0.0, 1.0);\n"
223 " texture_uv = vec4(0.0, 0.0, 0.0, 1.0);\n"
224 " } else {\n"
225 " texture_xyz = xyz[0];\n"
226 " texture_uv = uv[0];\n"
227 " }\n"
228 " }\n"
229 " else {\n"
230 " texture_xyz = xyz[0];\n"
231 " texture_uv = uv[0];\n"
232 " }\n"
233 " }\n"
234 "}";
235 
237 {
238 public:
241  texture_2d_shader::default_vertex_shader(),
243  "position", "textureCoords",
244  "output_xyz", "output_uv"))
245  {
246  _focal_location[0] = _shader->get_uniform_location("focal1");
247  _principal_location[0] = _shader->get_uniform_location("principal1");
248  _is_bc_location[0] = _shader->get_uniform_location("is_bc1");
249  _coeffs_location[0] = _shader->get_uniform_location("coeffs1");
250 
251  _focal_location[1] = _shader->get_uniform_location("focal2");
252  _principal_location[1] = _shader->get_uniform_location("principal2");
253  _is_bc_location[1] = _shader->get_uniform_location("is_bc2");
254  _coeffs_location[1] = _shader->get_uniform_location("coeffs2");
255 
256  _depth_scale_location = _shader->get_uniform_location("depth_scale");
257  _width_location[0] = _shader->get_uniform_location("width1");
258  _height_location[0] = _shader->get_uniform_location("height1");
259  _width_location[1] = _shader->get_uniform_location("width2");
260  _height_location[1] = _shader->get_uniform_location("height2");
261  _extrinsics_location = _shader->get_uniform_location("extrinsics");
262 
263  _requires_projection_location = _shader->get_uniform_location("needs_projection");
264  }
265 
267  {
268  _shader->load_uniform(_requires_projection_location, val ? 1.f : 0.f);
269  }
270 
271  void set_size(int id, int w, int h)
272  {
273  _shader->load_uniform(_width_location[id], (float)w);
274  _shader->load_uniform(_height_location[id], (float)h);
275  }
276 
278  {
279  rs2::float2 focal{ intr.fx, intr.fy };
280  rs2::float2 principal{ intr.ppx, intr.ppy };
281  _shader->load_uniform(_focal_location[idx], focal);
282  _shader->load_uniform(_principal_location[idx], principal);
283  _shader->load_uniform(_is_bc_location[idx], (float)(int)intr.model);
284  glUniform1fv(_coeffs_location[idx], 5, intr.coeffs);
285  }
286 
288  {
289  _shader->load_uniform(_depth_scale_location, depth_scale);
290  }
291 
293  {
294  rs2::matrix4 m;
295  for (int i = 0; i < 4; i++)
296  for (int j = 0; j < 4; j++)
297  {
298  if (i < 3 && j < 3) m.mat[i][j] = extr.rotation[i * 3 + j];
299  else if (i == 3 && j < 3) m.mat[i][j] = extr.translation[j];
300  else if (i < 3 && j == 3) m.mat[i][j] = 0.f;
301  else m.mat[i][j] = 1.f;
302  }
303  _shader->load_uniform(_extrinsics_location, m);
304  }
305 private:
306  uint32_t _focal_location[2];
307  uint32_t _principal_location[2];
308  uint32_t _is_bc_location[2];
309  uint32_t _coeffs_location[2];
311 
312  uint32_t _width_location[2];
313  uint32_t _height_location[2];
314 
316 
318 };
319 
321 {
322 public:
327  "position", "textureCoords",
328  "texture_xyz", "texture_uv"))
329  {
330  _width_location = _shader->get_uniform_location("width");
331  _height_location = _shader->get_uniform_location("height");
332 
333  _xyz_sampler_location = _shader->get_uniform_location("xyzSampler");
334  _uv_sampler_location = _shader->get_uniform_location("uvSampler");
335 
336  _scanning_location = _shader->get_uniform_location("vscan");
337  }
338 
339  void set_width(float width)
340  {
341  _shader->load_uniform(_width_location, width);
342  }
343 
344  void set_height(float height)
345  {
346  _shader->load_uniform(_height_location, height);
347  }
348 
350  {
351  _shader->load_uniform(_xyz_sampler_location, xyz);
352  }
353 
354  void set_uv_sampler(int uv)
355  {
356  _shader->load_uniform(_uv_sampler_location, uv);
357  }
358 
359  void set_scanning(int mode)
360  {
361  _shader->load_uniform(_scanning_location, mode);
362  }
363 private:
366 
369 
371 };
372 
373 void pointcloud_gl::cleanup_gpu_resources()
374 {
375  _projection_renderer.reset();
376  _occu_renderer.reset();
377  _enabled = 0;
378 }
379 void pointcloud_gl::create_gpu_resources()
380 {
381  if (glsl_enabled())
382  {
383  _projection_renderer = std::make_shared<visualizer_2d>(std::make_shared<project_shader>());
384  _occu_renderer = std::make_shared<visualizer_2d>(std::make_shared<occulution_shader>());
385  }
386  _enabled = glsl_enabled() ? 1 : 0;
387 }
388 
389 pointcloud_gl::~pointcloud_gl()
390 {
391  perform_gl_action([&]()
392  {
393  cleanup_gpu_resources();
394  }, []{});
395 }
396 
397 pointcloud_gl::pointcloud_gl()
398  : pointcloud("Pointcloud (GLSL)"), _depth_data(rs2::frame{})
399 {
401 
402  auto opt = std::make_shared<librealsense::ptr_option<int>>(
403  0, 1, 0, 1, &_enabled, "GLSL enabled");
405 
406  initialize();
407 }
408 
410  rs2::points output,
413  float depth_scale)
414 {
415  perform_gl_action([&]{
419  }, [&]{
420  _enabled = false;
421  });
422  return nullptr;
423 }
424 
426  rs2::points output,
428  const unsigned int width,
429  const unsigned int height,
430  const rs2_intrinsics &other_intrinsics,
431  const rs2_extrinsics& extr,
432  librealsense::float2* pixels_ptr)
433 {
434  perform_gl_action([&]{
435  auto viz = _projection_renderer;
436  auto frame_ref = (frame_interface*)output.get();
437 
438  auto gf = dynamic_cast<gpu_addon_interface*>(frame_ref);
439 
440  uint32_t depth_texture;
441 
442  if (auto input_frame = _depth_data.as<rs2::gl::gpu_frame>())
443  {
444  depth_texture = input_frame.get_texture_id(0);
445  }
446  else
447  {
448  glGenTextures(1, &depth_texture);
449  glBindTexture(GL_TEXTURE_2D, depth_texture);
450  auto depth_data = _depth_data.get_data();
451  glTexImage2D(GL_TEXTURE_2D, 0, GL_RG8, width, height, 0, GL_RG, GL_UNSIGNED_BYTE, depth_data);
454  }
455 
456  // rendering output
457  uint32_t output_xyz;
458  uint32_t output_uv;
459 
460  gf->get_gpu_section().output_texture(0, &output_xyz, TEXTYPE_XYZ);
461  gf->get_gpu_section().output_texture(1, &output_uv, TEXTYPE_UV);
462 
463  // fbo1 output
464  uint32_t fbo1_xyz;
465  uint32_t fbo1_uv;
466 
467  // run glsl occlusion removal if filter is active and between different sensors
468  bool run_glsl_occlusion_removal = _occlusion_filter->active() && !_occlusion_filter->is_same_sensor(extr);
469 
470  // when occlusion is turned on, output from fbo1 will be fed into fbo2 for additional processing before rendering to
471  // to final output output_xyz and output_uv, otherwise, fbo1 renders directly to final output
472  if (run_glsl_occlusion_removal)
473  {
474  glGenTextures(1, &fbo1_xyz);
475  glGenTextures(1, &fbo1_uv);
476  }
477  else
478  {
479  fbo1_xyz = output_xyz;
480  fbo1_uv = output_uv;
481  }
482 
483  // fbo1 - projection rendering
484  fbo fbo1(width, height);
485 
486  glBindTexture(GL_TEXTURE_2D, fbo1_xyz);
487  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_FLOAT, nullptr);
492 
495 
496  glBindTexture(GL_TEXTURE_2D, fbo1_uv);
497  glTexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, height, 0, GL_RG, GL_FLOAT, nullptr);
500 
503 
504  gf->get_gpu_section().set_size(width, height);
505 
506  fbo1.bind();
507 
509  glDrawBuffers(2, attachments);
510 
511  glClearColor(0, 0, 0, 1);
513 
514  auto& shader = (project_shader&)viz->get_shader();
515  shader.begin();
516 
517  shader.requires_projection(!(_depth_intr == other_intrinsics &&
518  extr == identity_matrix()));
519 
520  shader.set_depth_scale(_depth_scale);
521  shader.set_intrinsics(0, _depth_intr);
522  shader.set_intrinsics(1, other_intrinsics);
523  shader.set_extrinsics(extr);
524  shader.set_size(0, width, height);
525  shader.set_size(1, other_intrinsics.width, other_intrinsics.height);
526 
527  viz->draw_texture(depth_texture);
528  shader.end();
529 
530  fbo1.unbind();
531 
532  // fbo2 - occlusion with glsl
533  if (run_glsl_occlusion_removal)
534  {
535  auto oviz = _occu_renderer;
536 
537  fbo fbo2(width, height);
538 
539  glBindTexture(GL_TEXTURE_2D, output_xyz);
540  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB16F, width, height, 0, GL_RGB, GL_FLOAT, nullptr);
545 
548 
549  glBindTexture(GL_TEXTURE_2D, output_uv);
550  glTexImage2D(GL_TEXTURE_2D, 0, GL_RG16F, width, height, 0, GL_RG, GL_FLOAT, nullptr);
553 
554  glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, output_uv, 0);
556 
557  glDrawBuffers(2, attachments);
558 
559  glClearColor(0, 0, 0, 1);
561 
562  gf->get_gpu_section().set_size(width, height);
563 
564  fbo2.bind();
565 
566  auto& occu_shader = (occulution_shader&)oviz->get_shader();
567 
568  occu_shader.begin();
569 
570  occu_shader.set_width((float) width);
571  occu_shader.set_height((float) height);
572 
573  occu_shader.set_xyz_sampler(0);
574  occu_shader.set_uv_sampler(1);
575 
576  if (_occlusion_filter->find_scanning_direction(extr) == vertical)
577  {
578  // L500 - vertical scan
579  occu_shader.set_scanning(1);
580  }
581  else
582  {
583  // D400 - horizontal scan
584  occu_shader.set_scanning(0);
585  }
586 
587  oviz->draw_texture(fbo1_xyz, fbo1_uv);
588  occu_shader.end();
589 
590  fbo2.unbind();
591 
592  glDeleteTextures(1, &fbo1_xyz);
593  glDeleteTextures(1, &fbo1_uv);
594  }
595 
598  {
599  glDeleteTextures(1, &depth_texture);
600  }
601  }, [&]{
602  _enabled = false;
603  });
604 }
605 
607  const rs2::frame_source& source,
608  const rs2::frame& f)
609 {
610  auto prof = std::dynamic_pointer_cast<librealsense::stream_profile_interface>(
611  _output_stream.get()->profile->shared_from_this());
612  auto frame_ref = _source_wrapper.allocate_points(prof, (frame_interface*)f.get(),
614  rs2::frame res { (rs2_frame*)frame_ref };
615  return res.as<rs2::points>();
616 }
617 
619 {
620  // skip cpu filter when occlusion removed on gpu
621  return false;
622 }
#define glUniform1fv
std::shared_ptr< rs2::visualizer_2d > _projection_renderer
Definition: pointcloud-gl.h:41
#define GL_TEXTURE_MAG_FILTER
std::shared_ptr< occlusion_filter > _occlusion_filter
Definition: pointcloud.h:45
void set_xyz_sampler(int xyz)
#define GL_RG8
uint32_t _xyz_sampler_location
void set_height(float height)
rs2_frame * get() const
Definition: rs_frame.hpp:590
rs2::stream_profile _output_stream
Definition: pointcloud.h:50
void requires_projection(bool val)
#define glFramebufferTexture2D
#define GL_RG16F
void add_extension(rs2_extension ex)
Definition: source.h:45
#define GL_TEXTURE_2D
const GLfloat * m
Definition: glext.h:6814
void set_intrinsics(int idx, const rs2_intrinsics &intr)
float translation[3]
Definition: rs_sensor.h:99
#define GL_UNSIGNED_BYTE
#define glDrawBuffers
#define GL_RGB16F
#define GL_CLAMP_TO_EDGE
const void * get_data() const
Definition: rs_frame.hpp:545
float coeffs[5]
Definition: rs_types.h:67
Definition: cah-model.h:10
GLdouble GLdouble GLdouble w
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:1960
const float3 * depth_to_points(rs2::points output, const rs2_intrinsics &depth_intrinsics, const rs2::depth_frame &depth_frame, float depth_scale) override
#define glTexImage2D
rs2_extrinsics identity_matrix()
Definition: src/types.h:611
float rotation[9]
Definition: rs_sensor.h:98
#define GL_TEXTURE_WRAP_T
void bind()
Definition: opengl3.cpp:635
void register_option(rs2_option id, std::shared_ptr< option > option)
Definition: options.h:86
GLuint GLfloat * val
GLdouble f
bool is() const
Definition: rs_frame.hpp:570
GLenum mode
void set_size(int id, int w, int h)
#define glGenTextures
void get_texture_map(rs2::points output, const float3 *points, const unsigned int width, const unsigned int height, const rs2_intrinsics &other_intrinsics, const rs2_extrinsics &extr, float2 *pixels_ptr) override
#define GL_FLOAT
GLsizei const GLenum * attachments
Definition: glext.h:2477
#define GL_COLOR_BUFFER_BIT
#define glTexParameteri
#define GL_COLOR_ATTACHMENT1
unsigned int uint32_t
Definition: stdint.h:80
#define glClear
GLint GLsizei GLsizei height
static const char * occulution_fragment_text
void unbind()
Definition: opengl3.cpp:647
#define GL_TEXTURE_MIN_FILTER
GLint j
void set_uv_sampler(int uv)
float mat[4][4]
Definition: rendering.h:274
#define GL_RG
void set_scanning(int mode)
rs2::points allocate_points(const rs2::frame_source &source, const rs2::frame &f) override
#define glDeleteTextures
void set_extrinsics(const rs2_extrinsics &extr)
librealsense::stream_profile_interface * profile
Definition: context.h:34
Cross-stream extrinsics: encodes the topology describing how the different devices are oriented...
Definition: rs_sensor.h:96
rs2_distortion model
Definition: rs_types.h:66
#define RS2_EXTENSION_VIDEO_FRAME_GL
unsigned int GLuint
uint32_t _requires_projection_location
rs2_extrinsics extr
Definition: test-pose.cpp:258
const rs2_stream_profile * get() const
Definition: rs_frame.hpp:137
#define glBindTexture
static const char * project_fragment_text
void perform_gl_action(T action, S fallback)
Video stream intrinsics.
Definition: rs_types.h:58
#define glClearColor
GLsizei GLsizei GLchar * source
xyz
Definition: rmse.py:152
#define GL_COLOR_ATTACHMENT0
int i
GLuint res
Definition: glext.h:8856
#define GL_RGB
uint32_t _scanning_location
frame_interface * allocate_points(std::shared_ptr< stream_profile_interface > stream, frame_interface *original, rs2_extension frame_type=RS2_EXTENSION_POINTS) override
static const char * occulution_vertex_shader_text
std::shared_ptr< rs2::visualizer_2d > _occu_renderer
Definition: pointcloud-gl.h:42
#define GL_NEAREST
void set_depth_scale(float depth_scale)
#define GL_TEXTURE_WRAP_S
uint32_t _depth_scale_location
void set_width(float width)
#define GL_FRAMEBUFFER
struct rs2_frame rs2_frame
Definition: rs_types.h:261
GLint GLsizei width
bool run__occlusion_filter(const rs2_extrinsics &extr) override
uint32_t _extrinsics_location
T as() const
Definition: rs_frame.hpp:580
uint32_t _uv_sampler_location


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