From 91b7d53154b84e41c8ec2aa04ce4777cdd138720 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Fri, 19 Sep 2014 16:06:21 +0200 Subject: [PATCH] Fix QPixelFormat values The two mono formats are actually indexed and may have both color and alpha values in the color-table, and Format_ARGB4444_Premultiplied and Format_ARGB6666_Premultiplied both have the alpha value in the end. Change-Id: I7f1efb2213710f5eb628d71356f9c8ed75b50f4d Reviewed-by: Gunnar Sletta --- src/gui/image/qimage.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 32c81e39fa..d2c3c41812 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -4662,7 +4662,7 @@ static Q_CONSTEXPR QPixelFormat pixelformats[] = { //QImage::Format_Invalid: QPixelFormat(), //QImage::Format_Mono: - QPixelFormat(QPixelFormat::Grayscale, + QPixelFormat(QPixelFormat::Indexed, /*RED*/ 1, /*GREEN*/ 0, /*BLUE*/ 0, @@ -4675,7 +4675,7 @@ static Q_CONSTEXPR QPixelFormat pixelformats[] = { /*INTERPRETATION*/ QPixelFormat::UnsignedByte, /*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian), //QImage::Format_MonoLSB: - QPixelFormat(QPixelFormat::Grayscale, + QPixelFormat(QPixelFormat::Indexed, /*RED*/ 1, /*GREEN*/ 0, /*BLUE*/ 0, @@ -4787,7 +4787,7 @@ static Q_CONSTEXPR QPixelFormat pixelformats[] = { /*FIFTH*/ 0, /*ALPHA*/ 6, /*ALPHA USAGE*/ QPixelFormat::UsesAlpha, - /*ALPHA POSITION*/ QPixelFormat::AtBeginning, + /*ALPHA POSITION*/ QPixelFormat::AtEnd, /*PREMULTIPLIED*/ QPixelFormat::Premultiplied, /*INTERPRETATION*/ QPixelFormat::UnsignedInteger, /*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian), @@ -4852,7 +4852,7 @@ static Q_CONSTEXPR QPixelFormat pixelformats[] = { /*FIFTH*/ 0, /*ALPHA*/ 4, /*ALPHA USAGE*/ QPixelFormat::UsesAlpha, - /*ALPHA POSITION*/ QPixelFormat::AtBeginning, + /*ALPHA POSITION*/ QPixelFormat::AtEnd, /*PREMULTIPLIED*/ QPixelFormat::Premultiplied, /*INTERPRETATION*/ QPixelFormat::UnsignedShort, /*BYTE ORDER*/ QPixelFormat::CurrentSystemEndian),