Go to the documentation of this file.
23 CFBORender::CFBORender(
24 unsigned int width,
unsigned int height,
const bool skip_glut_window)
27 m_win_used(!skip_glut_window),
28 m_default_bk_color(.6f, .6f, .6f, 1)
30 #if MRPT_HAS_OPENCV && MRPT_HAS_OPENGL_GLUT
37 if (!glutGet(GLUT_INIT_STATE))
41 char* argv[1] = {
nullptr};
42 glutInit(&argc, argv);
46 m_win = glutCreateWindow(
"CFBORender");
59 "glDeleteFramebuffersEXT");
64 "glFramebufferTexture2DEXT");
86 #if defined(GL_TEXTURE_RECTANGLE_NV)
88 #elif defined(GL_TEXTURE_RECTANGLE_ARB)
120 #if MRPT_HAS_OPENGL_GLUT
158 #if MRPT_HAS_OPENCV && MRPT_HAS_OPENGL_GLUT
165 buffer.getChannelCount() != 3 ||
buffer.isOriginTopLeft() !=
false)
187 #if MRPT_HAS_OPENGL_GLUT
233 #if MRPT_HAS_OPENCV && MRPT_HAS_OPENGL_GLUT
249 #if defined(GL_TEXTURE_RECTANGLE_NV)
251 #elif defined(GL_TEXTURE_RECTANGLE_ARB)
282 #if MRPT_HAS_OPENGL_GLUT
286 const GLubyte* extensions =
nullptr;
291 where = (
GLubyte*)strchr(extension,
' ');
292 if (where || *extension ==
'\0')
return 0;
301 where = (
GLubyte*)strstr((
const char*)
start, extension);
303 terminator = where + strlen(extension);
304 if (where ==
start || *(where - 1) ==
' ')
305 if (*terminator ==
' ' || *terminator ==
'\0')
return 1;
GLAPI void GLAPIENTRY glViewport(GLint x, GLint y, GLsizei width, GLsizei height)
#define ASSERT_EQUAL_(__A, __B)
Assert comparing two values, reporting their actual values upon failure.
CCamera & getCamera(const COpenGLScene &scene)
Get a reference to the scene camera.
#define glGenFramebuffersEXT
void(GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
#define GL_TEXTURE_RECTANGLE_NV
This class allows the user to create, load, save, and render 3D scenes using OpenGL primitives.
void render_text_messages(const int w, const int h) const
Renders the messages to the current opengl rendering context (to be called OUT of MRPT mrpt::opengl r...
void resize(unsigned int width, unsigned int height)
Resize the rendering canvas size.
#define GL_TEXTURE_RECTANGLE_ARB
#define MRPT_UNUSED_PARAM(a)
Determines whether this is an X86 or AMD64 platform.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLAPI void GLAPIENTRY glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
#define THROW_EXCEPTION(msg)
#define ASSERT_(f)
Defines an assertion mechanism.
void setCamera(const COpenGLScene &scene, const CCamera &camera)
Change the scene camera.
void(GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC)(GLsizei n, GLuint *framebuffers)
#define glBindFramebufferEXT
#define glFramebufferTexture2DEXT
const GLAPI GLubyte *GLAPIENTRY glGetString(GLenum name)
void(GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC)(GLsizei n, const GLuint *framebuffers)
A camera: if added to a scene, the viewpoint defined by this camera will be used instead of the camer...
virtual ~CFBORender()
Destructor.
void getFrame(const COpenGLScene &scene, mrpt::img::CImage &image)
Render the scene and get the rendered rgb image.
GLAPI void GLAPIENTRY glReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
GLAPI void GLAPIENTRY glDeleteTextures(GLsizei n, const GLuint *textures)
GLAPI void GLAPIENTRY glGenTextures(GLsizei n, GLuint *textures)
GLenum GLsizei GLsizei height
A class for storing images as grayscale or RGB bitmaps.
void getFrame2(const COpenGLScene &scene, mrpt::img::CImage &image)
Render the scene and get the rendered rgb image.
GLAPI void GLAPIENTRY glClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
#define GL_TEXTURE_RECTANGLE_EXT
mrpt::img::TColorf m_default_bk_color
COpenGLViewport::Ptr getViewport(const std::string &viewportName=std::string("main")) const
Returns the viewport with the given name, or nullptr if it does not exist; note that the default view...
int isExtensionSupported(const char *extension)
Provide information on Framebuffer object extension.
The namespace for 3D scene representation and rendering.
#define GL_FRAMEBUFFER_EXT
#define glDeleteFramebuffersEXT
GLAPI void GLAPIENTRY glBindTexture(GLenum target, GLuint texture)
void render() const
Render this scene.
#define GL_COLOR_ATTACHMENT0_EXT
void(GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC)(GLenum target, GLuint framebuffer)
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |