diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-02-14 10:39:30 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-17 14:48:48 +0200 |
commit | d84a6eab5129ba29951a7ba6d82820b21cc9872e (patch) | |
tree | 1d794ecd3f37363a286f3eeda8e571c36ec4006c /src/gui/painting/qmemrotate.cpp | |
parent | bce19cb9063003af5924c643f6fc1416146b4242 (diff) |
Add Grayscale8 and Alpha8 formats to QImage and drawing
Extend the QImage format with two 8-bit grayscale and alpha formats.
These formats have the advantage over Indexed8 that they have simpler
conversion and can be rendered to by the raster engine.
[ChangeLog][QtGui][QImage] Added support grayscale and alpha 8-bit
formats which can also be rendered to.
Change-Id: I4343c80a92a3dda196aa38d0c3ea251b094fc274
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/gui/painting/qmemrotate.cpp')
-rw-r--r-- | src/gui/painting/qmemrotate.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/painting/qmemrotate.cpp b/src/gui/painting/qmemrotate.cpp index a5e12da3d1..ed82559187 100644 --- a/src/gui/painting/qmemrotate.cpp +++ b/src/gui/painting/qmemrotate.cpp @@ -481,6 +481,21 @@ QT_IMPL_MEMROTATE(quint16) QT_IMPL_MEMROTATE(quint24) QT_IMPL_MEMROTATE(quint8) +void qt_memrotate90_8(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl) +{ + qt_memrotate90(srcPixels, w, h, sbpl, destPixels, dbpl); +} + +void qt_memrotate180_8(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl) +{ + qt_memrotate180(srcPixels, w, h, sbpl, destPixels, dbpl); +} + +void qt_memrotate270_8(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl) +{ + qt_memrotate270(srcPixels, w, h, sbpl, destPixels, dbpl); +} + void qt_memrotate90_16(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl) { qt_memrotate90((const ushort *)srcPixels, w, h, sbpl, (ushort *)destPixels, dbpl); @@ -537,6 +552,8 @@ MemRotateFunc qMemRotateFunctions[QImage::NImageFormats][3] = { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_A2BGR30_Premultiplied, { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_RGB30, { qt_memrotate90_32, qt_memrotate180_32, qt_memrotate270_32 }, // Format_A2RGB30_Premultiplied, + { qt_memrotate90_8, qt_memrotate180_8, qt_memrotate270_8 }, // Format_Alpha8, + { qt_memrotate90_8, qt_memrotate180_8, qt_memrotate270_8 }, // Format_Grayscale8, }; QT_END_NAMESPACE |