From 171e137d25dccca15b31e6bd01de58776f3d9e94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Wed, 2 Nov 2011 17:02:11 +0100 Subject: Improve QtGui start-up time and memory use. The gamma lookup tables can be allocated and computed on demand, as they're not always needed, depending on the platform and the use case. Change-Id: I2d4c2860746366a0e46edb53bd4ecd2778de2464 Reviewed-by: Olivier Goffart --- src/gui/image/qimage.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gui/image/qimage.cpp') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index a19b608216..c107fea919 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -3340,9 +3340,13 @@ void qInitImageConversions() #endif } +extern const uchar *qt_pow_rgb_gamma(); + void qGamma_correct_back_to_linear_cs(QImage *image) { - extern uchar qt_pow_rgb_gamma[256]; + const uchar *gamma = qt_pow_rgb_gamma(); + if (!gamma) + return; // gamma correct the pixels back to linear color space... int h = image->height(); @@ -3352,9 +3356,9 @@ void qGamma_correct_back_to_linear_cs(QImage *image) uint *pixels = (uint *) image->scanLine(y); for (int x=0; x