Details
-
Bug
-
Resolution: Out of scope
-
P2: Important
-
None
-
5.2.1
-
None
-
Windows 7
Description
qt_gl_read_framebuffer does not work correctly.
QImage is initialized as:
QImage img(size, (alpha_format && include_alpha) ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32);
Since OpenGL does not support that premultiplied format, results are broken.
Workaround is to use:
QImage img(QSize(width, height), QImage::Format_RGBA8888);
GLint fmt = GL_RGBA;
glReadPixels(0, 0, w, h, fmt, GL_UNSIGNED_BYTE, img.bits());
Attached is the image how it looks like.
Left image is when scene is rendered using QOpenGLFramebufferObject and right image with the workaround used.
Attachments
Issue Links
- relates to
-
QTBUG-42510 QGLFramebufferObject saving image with PNG and TIFF formats causes red effect
- Closed