Qt 4.8
Macros | Functions
qglframebufferobject.cpp File Reference
#include "qglframebufferobject.h"
#include "qglframebufferobject_p.h"
#include <qdebug.h>
#include <private/qgl_p.h>
#include <private/qfont_p.h>
#include <private/qpaintengineex_opengl2_p.h>
#include <private/qpaintengine_opengl_p.h>
#include <qlibrary.h>
#include <qimage.h>

Go to the source code of this file.

Macros

#define QGL_FUNC_CONTEXT   const QGLContext *ctx = d_ptr->fbo_guard.context();
 
#define QGL_FUNCP_CONTEXT   const QGLContext *ctx = fbo_guard.context();
 
#define QT_CHECK_GLERROR()
 
#define QT_RESET_GLERROR()
 

Functions

QImage qt_gl_read_framebuffer (const QSize &, bool, bool)
 

Macro Definition Documentation

◆ QGL_FUNC_CONTEXT

#define QGL_FUNC_CONTEXT   const QGLContext *ctx = d_ptr->fbo_guard.context();

◆ QGL_FUNCP_CONTEXT

#define QGL_FUNCP_CONTEXT   const QGLContext *ctx = fbo_guard.context();

◆ QT_CHECK_GLERROR

#define QT_CHECK_GLERROR ( )
Value:
{ \
GLenum err = glGetError(); \
if (err != GL_NO_ERROR) { \
qDebug("[%s line %d] GL Error: %d", \
__FILE__, __LINE__, (int)err); \
} \
}
#define GL_NO_ERROR

Definition at line 72 of file qglframebufferobject.cpp.

Referenced by QGLFramebufferObjectPrivate::init().

◆ QT_RESET_GLERROR

#define QT_RESET_GLERROR ( )
Value:
{ \
while (glGetError() != GL_NO_ERROR) {} \
}
#define GL_NO_ERROR

Definition at line 68 of file qglframebufferobject.cpp.

Referenced by QGLFramebufferObjectPrivate::init().

Function Documentation

◆ qt_gl_read_framebuffer()

QImage qt_gl_read_framebuffer ( const QSize ,
bool  ,
bool   
)

Definition at line 1860 of file qgl.cpp.

Referenced by QGLFramebufferObject::toImage().

1861 {
1862  QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32_Premultiplied
1864  int w = size.width();
1865  int h = size.height();
1866  glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
1867  convertFromGLImage(img, w, h, alpha_format, include_alpha);
1868  return img;
1869 }
static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, bool include_alpha)
Definition: qgl.cpp:1818
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
#define GL_UNSIGNED_BYTE
#define GL_RGBA