diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-04-16 15:53:33 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-05-11 10:31:01 +0000 |
commit | 9c1290cecbe4c27d42d01132e4f42767c88ad2d0 (patch) | |
tree | 4f1ba968a653c3d33a79c31343f9dc7c420aabb0 /src | |
parent | ee60a044c9afeab408085cac0214e0c3cf8b837a (diff) |
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 <Venugopal.Shivashankar@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qimage.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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 |