From ffd316ebe3963b7ff8d94a3484ac85de793b8299 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 21 Nov 2016 15:10:39 +0100 Subject: Replace QDrawHelperGammaTables with QColorProfile Turns the two set of tables in QDrawHelperGammaTables into two QColorProfile classes that use similar structures and can be reused for other gamma correction. At the same time clean-up and improve the comma-correct blending code to use the new profiles and QRgba64 precision. Change-Id: I302bd87a5c836e1010fff6d633eeb56fd4ae2ff0 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/gui/image/qimage_conversions.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'src/gui/image/qimage_conversions.cpp') diff --git a/src/gui/image/qimage_conversions.cpp b/src/gui/image/qimage_conversions.cpp index c646ee96b4..d685d50d49 100644 --- a/src/gui/image/qimage_conversions.cpp +++ b/src/gui/image/qimage_conversions.cpp @@ -39,6 +39,7 @@ #include #include +#include #include #include #include @@ -82,23 +83,17 @@ const uchar *qt_get_bitflip_array() void qGamma_correct_back_to_linear_cs(QImage *image) { - const QDrawHelperGammaTables *tables = QGuiApplicationPrivate::instance()->gammaTables(); - if (!tables) + const QColorProfile *cp = QGuiApplicationPrivate::instance()->colorProfileForA32Text(); + if (!cp) return; - const uchar *gamma = tables->qt_pow_rgb_gamma; // gamma correct the pixels back to linear color space... int h = image->height(); int w = image->width(); for (int y=0; yscanLine(y); - for (int x=0; x(image->scanLine(y)); + for (int x=0; xtoLinear(pixels[x]); } } -- cgit v1.2.3