diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-10-28 10:41:31 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-10-28 13:04:18 (GMT) |
commit | 6a5a894dda402b433505447f14fb7ed9eeac8a48 (patch) | |
tree | 7c489cd94c4969c05bc00eb09081931d5f355e4e /src/gui/image/qimage.cpp | |
parent | 3d86d2a8e5e3c68f9e0022e676293ddc5288c849 (diff) | |
download | Qt-6a5a894dda402b433505447f14fb7ed9eeac8a48.zip Qt-6a5a894dda402b433505447f14fb7ed9eeac8a48.tar.gz Qt-6a5a894dda402b433505447f14fb7ed9eeac8a48.tar.bz2 |
Moving QCoreTextFontEngine with related classes into own file
The declaration of QCoreTextFontEngine was ifdefed in qfontengine_p.h.
So was QMacFontEngine. I have moved them into their own files
(qfontengine_coretext_p.h and qfontengine_mac_p.h).
Diffstat (limited to 'src/gui/image/qimage.cpp')
-rw-r--r-- | src/gui/image/qimage.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 5829fe8..ee0ee96 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3861,6 +3861,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. |