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/painting/qdrawhelper_p.h | |
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/painting/qdrawhelper_p.h')
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index 4dcfbc813b..37108949d6 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -879,6 +879,8 @@ static Q_ALWAYS_INLINE uint BYTE_MUL_RGB16_32(uint x, uint a) { // qt_div_255 is a fast rounded division by 255 using an approximation that is accurate for all positive 16-bit integers static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE int qt_div_255(int x) { return (x + (x>>8) + 0x80) >> 8; } +static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_div_257_floor(uint x) { return (x - (x >> 8)) >> 8; } +static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_div_257(uint x) { return qt_div_257_floor(x + 128); } static Q_DECL_CONSTEXPR Q_ALWAYS_INLINE uint qt_div_65535(uint x) { return (x + (x>>16) + 0x8000U) >> 16; } static Q_ALWAYS_INLINE uint qAlphaRgb30(uint c) |