summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-04-03 09:16:40 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-04-07 06:30:14 (GMT)
commit974680679b03c668ffce87bd50b5dacf44b0fa22 (patch)
tree7a5a67e562e9657e12f59b62584e4ac7ecb06943 /src/gui/image
parente0560bcaa3703fafccc21dd709731341a123a0e4 (diff)
downloadQt-974680679b03c668ffce87bd50b5dacf44b0fa22.zip
Qt-974680679b03c668ffce87bd50b5dacf44b0fa22.tar.gz
Qt-974680679b03c668ffce87bd50b5dacf44b0fa22.tar.bz2
Adds a few \warnings to the docs on do-not-use-for-performance-reasons
Reviewed-by: Trond
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qimage.cpp12
-rw-r--r--src/gui/image/qpixmap.cpp18
2 files changed, 27 insertions, 3 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index dc236e4..6945ef8 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -114,7 +114,7 @@ Q_GUI_EXPORT _qt_image_cleanup_hook qt_image_cleanup_hook = 0;
typedef void (*_qt_image_cleanup_hook_64)(qint64);
Q_GUI_EXPORT _qt_image_cleanup_hook_64 qt_image_cleanup_hook_64 = 0;
-static QImage rotated90(const QImage &src);
+static QImage rotated90(const QImage &src);=
static QImage rotated180(const QImage &src);
static QImage rotated270(const QImage &src);
@@ -3607,6 +3607,9 @@ int QImage::pixelIndex(int x, int y) const
If the \a position is not valid, the results are undefined.
+ \warning This function is expensive when used for massive pixel
+ manipulations.
+
\sa setPixel(), valid(), {QImage#Pixel Manipulation}{Pixel
Manipulation}
*/
@@ -5581,6 +5584,8 @@ bool QImage::isDetached() const
Use one of the composition mods in QPainter::CompositionMode instead.
+ \warning This function is expensive.
+
\sa alphaChannel(), {QImage#Image Transformations}{Image
Transformations}, {QImage#Image Formats}{Image Formats}
*/
@@ -5663,6 +5668,11 @@ void QImage::setAlphaChannel(const QImage &alphaChannel)
\l{QPixmap::}{alphaChannel()}, which works in the same way as
this function on QPixmaps.
+ Most usecases for this function can be replaced with QPainter and
+ using composition modes.
+
+ \warning This is an expensive function.
+
\sa setAlphaChannel(), hasAlphaChannel(),
{QPixmap#Pixmap Information}{Pixmap},
{QImage#Image Transformations}{Image Transformations}
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp
index 8684a1b..efb8260 100644
--- a/src/gui/image/qpixmap.cpp
+++ b/src/gui/image/qpixmap.cpp
@@ -674,7 +674,7 @@ void QPixmap::resize_helper(const QSize &s)
pixels black. The effect of this function is undefined when the pixmap is
being painted on.
- This is potentially an expensive operation.
+ \warning This is potentially an expensive operation.
\sa mask(), {QPixmap#Pixmap Transformations}{Pixmap Transformations},
QBitmap
@@ -1380,6 +1380,12 @@ void QPixmap::deref()
If the given \a size is empty, this function returns a null
pixmap.
+
+ In some cases it can be more beneficial to draw the pixmap to a
+ painter with a scale set rather than scaling the pixmap. This is
+ the case when the painter is for instance based on OpenGL or when
+ the scale factor changes rapidly.
+
\sa isNull(), {QPixmap#Pixmap Transformations}{Pixmap
Transformations}
@@ -1751,6 +1757,10 @@ int QPixmap::metric(PaintDeviceMetric metric) const
The effect of this function is undefined when the pixmap is being
painted on.
+ \warning This is potentially an expensive operation. Most usecases
+ for this function are covered by QPainter and compositionModes
+ which will normally execute faster.
+
\sa alphaChannel(), {QPixmap#Pixmap Transformations}{Pixmap
Transformations}
*/
@@ -1793,6 +1803,9 @@ void QPixmap::setAlphaChannel(const QPixmap &alphaChannel)
\image alphachannelimage.png The pixmap and channelImage QPixmaps
+ \warning This is an expensive operation. The alpha channel of the
+ pixmap is extracted dynamically from the pixeldata.
+
\sa setAlphaChannel(), {QPixmap#Pixmap Information}{Pixmap
Information}
*/
@@ -1814,7 +1827,8 @@ QPaintEngine *QPixmap::paintEngine() const
Extracts a bitmap mask from the pixmap's alphachannel.
- This is potentially an expensive operation.
+ \warning This is potentially an expensive operation. The mask of
+ the pixmap is extracted dynamically from the pixeldata.
\sa setMask(), {QPixmap#Pixmap Information}{Pixmap Information}
*/