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/painting/qdrawhelper_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/painting/qdrawhelper_p.h')
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index bddd6899e3..078ab62251 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -1143,6 +1143,8 @@ static Q_ALWAYS_INLINE const uint *qt_convertRGBA8888ToARGB32PM(uint *buffer, co return buffer; } +template<bool RGBA> void qt_convertRGBA64ToARGB32(uint *dst, const QRgba64 *src, int count); + const uint qt_bayer_matrix[16][16] = { { 0x1, 0xc0, 0x30, 0xf0, 0xc, 0xcc, 0x3c, 0xfc, 0x3, 0xc3, 0x33, 0xf3, 0xf, 0xcf, 0x3f, 0xff}, @@ -1232,9 +1234,15 @@ typedef const uint *(QT_FASTCALL *FetchAndConvertPixelsFunc)(uint *buffer, const typedef void (QT_FASTCALL *ConvertAndStorePixelsFunc)(uchar *dest, const uint *src, int index, int count, const QVector<QRgb> *clut, QDitherInfo *dither); +typedef const QRgba64 *(QT_FASTCALL *FetchAndConvertPixelsFunc64)(QRgba64 *buffer, const uchar *src, int index, int count, + const QVector<QRgb> *clut, QDitherInfo *dither); +typedef void (QT_FASTCALL *ConvertAndStorePixelsFunc64)(uchar *dest, const QRgba64 *src, int index, int count, + const QVector<QRgb> *clut, QDitherInfo *dither); + typedef void (QT_FASTCALL *ConvertFunc)(uint *buffer, int count, const QVector<QRgb> *clut); -typedef const QRgba64 *(QT_FASTCALL *ConvertFunc64)(QRgba64 *buffer, const uint *src, int count, - const QVector<QRgb> *clut, QDitherInfo *dither); +typedef void (QT_FASTCALL *Convert64Func)(quint64 *buffer, int count, const QVector<QRgb> *clut); +typedef const QRgba64 *(QT_FASTCALL *ConvertTo64Func)(QRgba64 *buffer, const uint *src, int count, + const QVector<QRgb> *clut, QDitherInfo *dither); typedef void (QT_FASTCALL *RbSwapFunc)(uchar *dst, const uchar *src, int count); @@ -1249,6 +1257,7 @@ struct QPixelLayout BPP16, BPP24, BPP32, + BPP64, BPPCount }; @@ -1257,17 +1266,19 @@ struct QPixelLayout BPP bpp; RbSwapFunc rbSwap; ConvertFunc convertToARGB32PM; - ConvertFunc64 convertToARGB64PM; + ConvertTo64Func convertToRGBA64PM; FetchAndConvertPixelsFunc fetchToARGB32PM; + FetchAndConvertPixelsFunc64 fetchToRGBA64PM; ConvertAndStorePixelsFunc storeFromARGB32PM; ConvertAndStorePixelsFunc storeFromRGB32; }; +extern ConvertAndStorePixelsFunc64 qStoreFromRGBA64PM[QImage::NImageFormats]; + extern QPixelLayout qPixelLayouts[QImage::NImageFormats]; extern MemRotateFunc qMemRotateFunctions[QPixelLayout::BPPCount][3]; - QT_END_NAMESPACE #endif // QDRAWHELPER_P_H |