MRPT
2.0.4
|
A class for rendering 3D scenes off-screen directly into an image using OpenGL extensions (glext).
To define a background color, set it in the scene's "main" viewport.
You can add overlaid text messages, see base class CTextMessageCapable
Definition at line 26 of file CFBORender.h.
#include <mrpt/opengl/CFBORender.h>
Public Member Functions | |
CFBORender (unsigned int width=800, unsigned int height=600, const bool skip_glut_window=false) | |
Constructor. More... | |
virtual | ~CFBORender () |
Destructor. More... | |
void | setCamera (const COpenGLScene &scene, const CCamera &camera) |
Change the scene camera. More... | |
CCamera & | getCamera (const COpenGLScene &scene) |
Get a reference to the scene camera. More... | |
void | getFrame (const COpenGLScene &scene, mrpt::img::CImage &image) |
Render the scene and get the rendered rgb image. More... | |
void | getFrame2 (const COpenGLScene &scene, mrpt::img::CImage &image) |
Render the scene and get the rendered rgb image. More... | |
void | resize (unsigned int width, unsigned int height) |
Resize the rendering canvas size. More... | |
const mrpt::img::TColorf & | getBackgroundColor () const |
Get the default background color (unles an COpenGLViewport defines a custom color) More... | |
void | setBackgroundColor (const mrpt::img::TColorf &col) |
Set the default background color (unles an COpenGLViewport defines a custom color) More... | |
Protected Member Functions | |
int | isExtensionSupported (const char *extension) |
Provide information on Framebuffer object extension. More... | |
Protected Attributes | |
int | m_win |
int | m_width |
int | m_height |
unsigned int | m_fbo {0} |
unsigned int | m_tex {0} |
bool | m_win_used |
mrpt::img::TColorf | m_default_bk_color |
CFBORender::CFBORender | ( | unsigned int | width = 800 , |
unsigned int | height = 600 , |
||
const bool | skip_glut_window = false |
||
) |
Constructor.
[in] | skip_glut_window | Should be set to true only if another GUI windows already exist with an associated OpenGL context. If left to false, a hidden GLUT window will be created. |
Definition at line 23 of file CFBORender.cpp.
References argc, argv, ASSERT_, isExtensionSupported(), m_fbo, m_height, m_tex, m_width, m_win, m_win_used, MRPT_END, MRPT_START, and THROW_EXCEPTION.
|
virtual |
Destructor.
Definition at line 118 of file CFBORender.cpp.
References m_fbo, m_tex, m_win, and m_win_used.
|
inline |
Get the default background color (unles an COpenGLViewport defines a custom color)
Definition at line 66 of file CFBORender.h.
References m_default_bk_color.
CCamera & CFBORender::getCamera | ( | const COpenGLScene & | scene | ) |
Get a reference to the scene camera.
Definition at line 143 of file CFBORender.cpp.
References mrpt::opengl::COpenGLScene::getViewport(), MRPT_END, and MRPT_START.
void CFBORender::getFrame | ( | const COpenGLScene & | scene, |
mrpt::img::CImage & | image | ||
) |
Render the scene and get the rendered rgb image.
Resizes the image buffer if it is necessary.
Definition at line 156 of file CFBORender.cpp.
References mrpt::img::CH_RGB, getFrame2(), m_height, m_width, MRPT_END, and MRPT_START.
void CFBORender::getFrame2 | ( | const COpenGLScene & | scene, |
mrpt::img::CImage & | image | ||
) |
Render the scene and get the rendered rgb image.
Does not resize the image buffer. MANDATORY: The image origin must be bottom left.
Definition at line 183 of file CFBORender.cpp.
References mrpt::img::TColorf::A, ASSERT_EQUAL_, mrpt::img::TColorf::B, mrpt::img::TColorf::G, m_default_bk_color, m_fbo, m_height, m_width, MRPT_END, MRPT_START, and mrpt::img::TColorf::R.
Referenced by getFrame().
|
protected |
Provide information on Framebuffer object extension.
Definition at line 270 of file CFBORender.cpp.
References MRPT_END, and MRPT_START.
Referenced by CFBORender().
void CFBORender::resize | ( | unsigned int | width, |
unsigned int | height | ||
) |
Resize the rendering canvas size.
Definition at line 223 of file CFBORender.cpp.
References m_fbo, m_height, m_tex, m_width, MRPT_END, and MRPT_START.
|
inline |
Set the default background color (unles an COpenGLViewport defines a custom color)
Definition at line 73 of file CFBORender.h.
References m_default_bk_color.
void CFBORender::setCamera | ( | const COpenGLScene & | scene, |
const CCamera & | camera | ||
) |
Change the scene camera.
Definition at line 131 of file CFBORender.cpp.
References mrpt::opengl::COpenGLScene::getViewport(), MRPT_END, and MRPT_START.
|
protected |
Definition at line 82 of file CFBORender.h.
Referenced by getBackgroundColor(), getFrame2(), and setBackgroundColor().
|
protected |
Definition at line 80 of file CFBORender.h.
Referenced by CFBORender(), getFrame2(), resize(), and ~CFBORender().
|
protected |
Definition at line 79 of file CFBORender.h.
Referenced by CFBORender(), getFrame(), getFrame2(), and resize().
|
protected |
Definition at line 80 of file CFBORender.h.
Referenced by CFBORender(), resize(), and ~CFBORender().
|
protected |
Definition at line 79 of file CFBORender.h.
Referenced by CFBORender(), getFrame(), getFrame2(), and resize().
|
protected |
Definition at line 79 of file CFBORender.h.
Referenced by CFBORender(), and ~CFBORender().
|
protected |
Definition at line 81 of file CFBORender.h.
Referenced by CFBORender(), and ~CFBORender().
Page generated by Doxygen 1.8.14 for MRPT 2.0.4 Git: 33de1d0ad Sat Jun 20 11:02:42 2020 +0200 at sáb jun 20 17:35:17 CEST 2020 |