diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-12-07 14:37:12 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-11 14:12:48 +0000 |
commit | 9c9f98f2ff255da3e9a3ccdb81a82c53a105c8f9 (patch) | |
tree | 2f352bdf94b81d24271b7ce9e2bab3174ad0dff7 /src/gui/image/qimage_p.h | |
parent | 1c623bc6d1c0a7ca52d81ca72c64f36898b3e12c (diff) |
Implement support for 16bpc image formats
Adds support for 16bit per color image formats in QImage. This makes it
possible to read and write 16bpc PNGs, and take full advantage of the
16bpc paint engine.
[ChangeLog][QtGui][QImage] QImage now supports 64bit image formats with
16 bits per color channel, compatible with 16bpc PNG or RGBA16 OpenGL
formats.
Task-number: QTBUG-45858
Change-Id: Icd28bd5868a6efcf65cb5bd56031d42941e04099
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/gui/image/qimage_p.h')
-rw-r--r-- | src/gui/image/qimage_p.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/image/qimage_p.h b/src/gui/image/qimage_p.h index f5fea2ed00..2fe29a88d3 100644 --- a/src/gui/image/qimage_p.h +++ b/src/gui/image/qimage_p.h @@ -113,6 +113,7 @@ extern Image_Converter qimage_converter_map[QImage::NImageFormats][QImage::NImag extern InPlace_Image_Converter qimage_inplace_converter_map[QImage::NImageFormats][QImage::NImageFormats]; void convert_generic(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags); +void convert_generic_to_rgb64(QImageData *dest, const QImageData *src, Qt::ImageConversionFlags); bool convert_generic_inplace(QImageData *data, QImage::Format dst_format, Qt::ImageConversionFlags); void dither_to_Mono(QImageData *dst, const QImageData *src, Qt::ImageConversionFlags flags, bool fromalpha); @@ -164,6 +165,11 @@ inline int qt_depthForFormat(QImage::Format format) case QImage::Format_RGB888: depth = 24; break; + case QImage::Format_RGBX64: + case QImage::Format_RGBA64: + case QImage::Format_RGBA64_Premultiplied: + depth = 64; + break; } return depth; } @@ -190,6 +196,9 @@ inline QImage::Format qt_opaqueVersion(QImage::Format format) return QImage::Format_BGR30; case QImage::Format_A2RGB30_Premultiplied: return QImage::Format_RGB30; + case QImage::Format_RGBA64: + case QImage::Format_RGBA64_Premultiplied: + return QImage::Format_RGBX64; case QImage::Format_ARGB32_Premultiplied: case QImage::Format_ARGB32: default: @@ -214,6 +223,8 @@ inline QImage::Format qt_alphaVersion(QImage::Format format) return QImage::Format_A2BGR30_Premultiplied; case QImage::Format_RGB30: return QImage::Format_A2RGB30_Premultiplied; + case QImage::Format_RGBX64: + return QImage::Format_RGBA64_Premultiplied; default: break; } |