diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-02-20 13:45:32 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-09-09 00:14:49 +0100 |
commit | d263ab6af5bd264217cb0beb389586163c5a8348 (patch) | |
tree | 675bb2ec7de6cb174bd938903bf3079872a58086 /src/gui/image/qimage.h | |
parent | aa5f3c829c308b6765aa390524ad840bd33258e8 (diff) |
Create consistent sets of QImage methods
Adds consistently named inplace and imperative methods.
Change-Id: I8739c1c4585d2ba4aa181bb9a681255d76c120d7
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/image/qimage.h')
-rw-r--r-- | src/gui/image/qimage.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gui/image/qimage.h b/src/gui/image/qimage.h index 1d4ee3168f..0866984dec 100644 --- a/src/gui/image/qimage.h +++ b/src/gui/image/qimage.h @@ -170,6 +170,10 @@ public: Qt::ImageConversionFlags flags = Qt::AutoColor) const; bool reinterpretAsFormat(Format f); + Q_REQUIRED_RESULT QImage convertedTo(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) const & + { return convertToFormat(f, flags); } + Q_REQUIRED_RESULT QImage convertedTo(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor) && + { return convertToFormat(f, flags); } void convertTo(Format f, Qt::ImageConversionFlags flags = Qt::AutoColor); int width() const; @@ -245,14 +249,18 @@ public: QImage scaledToHeight(int h, Qt::TransformationMode mode = Qt::FastTransformation) const; QImage transformed(const QTransform &matrix, Qt::TransformationMode mode = Qt::FastTransformation) const; static QTransform trueMatrix(const QTransform &, int w, int h); - QImage mirrored(bool horizontally = false, bool vertically = true) const & + Q_REQUIRED_RESULT QImage mirrored(bool horizontally = false, bool vertically = true) const & { return mirrored_helper(horizontally, vertically); } - QImage &&mirrored(bool horizontally = false, bool vertically = true) && + Q_REQUIRED_RESULT QImage mirrored(bool horizontally = false, bool vertically = true) && { mirrored_inplace(horizontally, vertically); return std::move(*this); } - QImage rgbSwapped() const & + Q_REQUIRED_RESULT QImage rgbSwapped() const & { return rgbSwapped_helper(); } - QImage &&rgbSwapped() && + Q_REQUIRED_RESULT QImage rgbSwapped() && { rgbSwapped_inplace(); return std::move(*this); } + void mirror(bool horizontally = false, bool vertically = true) + { mirrored_inplace(horizontally, vertically); } + void rgbSwap() + { rgbSwapped_inplace(); } void invertPixels(InvertMode = InvertRgb); QColorSpace colorSpace() const; |