diff options
author | Gerhard Roethlin <git@the-color-black.net> | 2011-02-24 11:23:59 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-24 11:23:59 (GMT) |
commit | 3cca3491777110f34276b4f44ccf355c3dcd6dbc (patch) | |
tree | 502f4099d651c5c1fdf73f526a14356e3e231394 | |
parent | 244620438700464a862ceab7c881974a5b1d1fea (diff) | |
download | Qt-3cca3491777110f34276b4f44ccf355c3dcd6dbc.zip Qt-3cca3491777110f34276b4f44ccf355c3dcd6dbc.tar.gz Qt-3cca3491777110f34276b4f44ccf355c3dcd6dbc.tar.bz2 |
OpenGL Framebuffer Format
OpenGL's framebuffer contains data with premultiplied alpha images,
so QImage::Format_ARGB32_Premultiplied should be used instead of
QImage::Format_ARGB32 to store it. Alternatively, the color values
could be divided by the alpha to restore the original color.
Merge-request: 1102
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r-- | src/opengl/qgl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 0ec3a15..76621e9 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -1791,7 +1791,7 @@ static void convertFromGLImage(QImage &img, int w, int h, bool alpha_format, boo QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha) { - QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32 + QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); int w = size.width(); int h = size.height(); |