MCPcopy Create free account
hub / github.com/PointCloudLibrary/pcl / getColorBuffer

Method getColorBuffer

simulation/src/range_likelihood.cpp:1225–1252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1223}
1224
1225const std::uint8_t*
1226RangeLikelihood::getColorBuffer() const
1227{
1228 // It's only possible to read the color buffer if it
1229 // was rendered in the first place.
1230 assert(use_color_);
1231
1232 if (color_buffer_dirty_) {
1233 std::cout << "Read color buffer" << std::endl;
1234
1235 // Read Color
1236 GLint old_read_buffer;
1237 glGetIntegerv(GL_READ_BUFFER, &old_read_buffer);
1238
1239 glBindFramebuffer(GL_FRAMEBUFFER, fbo_);
1240 glReadBuffer(GL_COLOR_ATTACHMENT0);
1241 glReadPixels(0, 0, width_, height_, GL_RGB, GL_UNSIGNED_BYTE, color_buffer_);
1242 glBindFramebuffer(GL_FRAMEBUFFER, 0);
1243 glReadBuffer(old_read_buffer);
1244
1245 if (gllib::getGLError() != GL_NO_ERROR) {
1246 std::cerr << "GL Error: RangeLikelihood::getColorBuffer" << std::endl;
1247 }
1248
1249 color_buffer_dirty_ = false;
1250 }
1251 return color_buffer_;
1252}
1253
1254// The scores are in score_texture_
1255const float*

Callers 5

captureFunction · 0.80
captureFunction · 0.80
displayFunction · 0.80
displayFunction · 0.80
write_sim_outputFunction · 0.80

Calls

no outgoing calls

Tested by 2

displayFunction · 0.64
displayFunction · 0.64