From 9c1290cecbe4c27d42d01132e4f42767c88ad2d0 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Mon, 16 Apr 2018 15:53:33 +0200 Subject: Doc: add explanation of return format of QImage::transformed() QImage::transformed() can sometimes return an image with a different image format than the original. This might be unexpected, so explain it in the doc. Task-number: QTBUG-50087 Change-Id: I165fc7b44439b770b542be52d3108fd70bf0ae99 Reviewed-by: Venugopal Shivashankar --- src/gui/image/qimage.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp index 907f90f3a5..85f0d2b251 100644 --- a/src/gui/image/qimage.cpp +++ b/src/gui/image/qimage.cpp @@ -2775,6 +2775,13 @@ QMatrix QImage::trueMatrix(const QMatrix &matrix, int w, int h) Returns a copy of the image that is transformed using the given transformation \a matrix and transformation \a mode. + The returned image will normally have the same {Image Formats}{format} as + the original image. However, a complex transformation may result in an + image where not all pixels are covered by the transformed pixels of the + original image. In such cases, those background pixels will be assigned a + transparent color value, and the transformed image will be given a format + with an alpha channel, even if the orginal image did not have that. + The transformation \a matrix is internally adjusted to compensate for unwanted translation; i.e. the image produced is the smallest image that contains all the transformed points of the original @@ -4570,6 +4577,13 @@ static QImage rotated270(const QImage &image) Returns a copy of the image that is transformed using the given transformation \a matrix and transformation \a mode. + The returned image will normally have the same {Image Formats}{format} as + the original image. However, a complex transformation may result in an + image where not all pixels are covered by the transformed pixels of the + original image. In such cases, those background pixels will be assigned a + transparent color value, and the transformed image will be given a format + with an alpha channel, even if the orginal image did not have that. + The transformation \a matrix is internally adjusted to compensate for unwanted translation; i.e. the image produced is the smallest image that contains all the transformed points of the original -- cgit v1.2.3