diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-11-20 10:04:28 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-12-12 22:26:49 +0000 |
commit | fc2ec95587c431b1916ec5590b7ef634be96c985 (patch) | |
tree | 37e38ef0fbf21af77001bc97f1080dd6ae92edef /src/gui/image/qpixmap_raster.cpp | |
parent | d20c9805763ab3dc504ebf2cefd33499d89ef22c (diff) |
Add Grayscale16 Image Format
[ChangeLog][QtGui][QImage] Added support for 16-bit grayscale format.
Together-with: Aaron Linville<aaron@linville.org>
Task-number: QTBUG-41176
Change-Id: I5fe4f54a55ebe1413aa71b882c19627fe22362ac
Reviewed-by: Nick D'Ademo <nickdademo@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 13c1c29d5b..2732bbd197 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -203,6 +203,9 @@ void QRasterPlatformPixmap::fill(const QColor &color) pixel = qAlpha(color.rgba()); } else if (image.format() == QImage::Format_Grayscale8) { pixel = qGray(color.rgba()); + } else if (image.format() == QImage::Format_Grayscale16) { + QRgba64 c = color.rgba64(); + pixel = qGray(c.red(), c.green(), c.blue()); } else { pixel = 0; |