summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qimage.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-12-02 16:08:49 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-12-02 16:08:49 (GMT)
commitb4e64dc59fb860f16600e13061bd588b90c213fb (patch)
tree9e0217a8f73daea321d1408de3e95e6a7f6e0138 /src/gui/image/qimage.cpp
parentc4f842d4a5b61a2618c50f6c26041da4e42d029d (diff)
parent697f2f96eccaaf9feb2f6e92603e86e30e67cdb8 (diff)
downloadQt-b4e64dc59fb860f16600e13061bd588b90c213fb.zip
Qt-b4e64dc59fb860f16600e13061bd588b90c213fb.tar.gz
Qt-b4e64dc59fb860f16600e13061bd588b90c213fb.tar.bz2
Merge branch 'staging-master' of scm.dev.nokia.troll.no:qt/qt-lighthouse into master-integration
* 'staging-master' of scm.dev.nokia.troll.no:qt/qt-lighthouse: (23 commits) Restore patch that got lost in merge Fix spelling in comment Spelling mistakes in Documentation. There are probably more :) Fix spelling mistake in QEGLPlatformcontext Restore patch that disappeared in merge Make the openKODE use the new eventloopintegration api. Make QtOpenGL use shared contextexts on Lighthouse Move the Lighthouse specfic api into qpa_qpa.cpp Lighthouse: Fix QGLContext::currentContext for systems with limited Make EglFS plugin compile after changes to QPlatformEGLContext Adding some documentation for Lighthouse Lighthouse: move the currentContext functionality to QPlatformGLContext Remove QWidget::paintEngine() codepath for Lighthouse Fix transformIsSimple in QGraphicsScene Lighthouse: Make sure that we call QPlatformWindow::setVisible Lighthouse: using QFont enums when possible in QPlatformFontdatabase No more windowsurface for QGLWidget in Lighthouse Add workaround_brokenFBOReadback=true for mali Fix cross-compilation for Lighthouse after 3d86d2a8e5e3c68f9e0022e67629 Compile fix for c1148ee9a60a6fae8. ...
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r--src/gui/image/qimage.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 747dd2f..bb94788c 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -3833,6 +3833,26 @@ void qInitImageConversions()
#endif
}
+void qGamma_correct_back_to_linear_cs(QImage *image)
+{
+ extern uchar qt_pow_rgb_gamma[256];
+
+ // gamma correct the pixels back to linear color space...
+ int h = image->height();
+ int w = image->width();
+
+ for (int y=0; y<h; ++y) {
+ uint *pixels = (uint *) image->scanLine(y);
+ for (int x=0; x<w; ++x) {
+ uint p = pixels[x];
+ uint r = qt_pow_rgb_gamma[qRed(p)];
+ uint g = qt_pow_rgb_gamma[qGreen(p)];
+ uint b = qt_pow_rgb_gamma[qBlue(p)];
+ pixels[x] = (r << 16) | (g << 8) | b | 0xff000000;
+ }
+ }
+}
+
/*!
Returns a copy of the image in the given \a format.