diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2010-02-23 09:11:03 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2010-02-23 09:11:03 (GMT) |
commit | 58533cbc7322c4f821f24043028e47925b537419 (patch) | |
tree | 6821780e44a2a603e828b10e6c7307b06ec1e8e3 /src/gui/painting/qpainter.h | |
parent | a948f901b196bab121cb8b5736204b4ce0c09e94 (diff) | |
download | Qt-58533cbc7322c4f821f24043028e47925b537419.zip Qt-58533cbc7322c4f821f24043028e47925b537419.tar.gz Qt-58533cbc7322c4f821f24043028e47925b537419.tar.bz2 |
Made the qDrawPixmaps() API public (with modifications).
QPainter has now gotten a drawPixmapFragments() function together
with a Fragment class that describes how each pixmap fragment is
supposed to be drawn.
Reviewed-by: Gunnar
Reviewed-by: Samuel
Diffstat (limited to 'src/gui/painting/qpainter.h')
-rw-r--r-- | src/gui/painting/qpainter.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/painting/qpainter.h b/src/gui/painting/qpainter.h index e9fd532..4d52c5d 100644 --- a/src/gui/painting/qpainter.h +++ b/src/gui/painting/qpainter.h @@ -99,6 +99,28 @@ public: Q_DECLARE_FLAGS(RenderHints, RenderHint) + class Fragment { + public: + qreal x; + qreal y; + qreal sourceLeft; + qreal sourceTop; + qreal width; + qreal height; + qreal scaleX; + qreal scaleY; + qreal rotation; + qreal opacity; + static Fragment create(const QPointF &pos, const QRectF &sourceRect, qreal scaleX = 1, + qreal scaleY = 1, qreal rotation = 0, qreal opacity = 1); + }; + + enum FragmentHint { + OpaqueHint = 0x01 + }; + + Q_DECLARE_FLAGS(FragmentHints, FragmentHint) + QPainter(); explicit QPainter(QPaintDevice *); ~QPainter(); @@ -352,6 +374,9 @@ public: inline void drawPixmap(const QRect &r, const QPixmap &pm); inline void drawPixmap(int x, int y, int w, int h, const QPixmap &pm); + void drawPixmapFragments(const Fragment *fragments, int fragmentCount, + const QPixmap &pixmap, FragmentHints hints = 0); + void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags = Qt::AutoColor); inline void drawImage(const QRect &targetRect, const QImage &image, const QRect &sourceRect, |