1// qgraphicseffect.sip generated by MetaSIP
2//
3// This file is part of the QtWidgets Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QGraphicsEffect : QObject
24{
25%TypeHeaderCode
26#include <qgraphicseffect.h>
27%End
28
29public:
30    enum ChangeFlag
31    {
32        SourceAttached,
33        SourceDetached,
34        SourceBoundingRectChanged,
35        SourceInvalidated,
36    };
37
38    typedef QFlags<QGraphicsEffect::ChangeFlag> ChangeFlags;
39
40    enum PixmapPadMode
41    {
42        NoPad,
43        PadToTransparentBorder,
44        PadToEffectiveBoundingRect,
45    };
46
47    QGraphicsEffect(QObject *parent /TransferThis/ = 0);
48    virtual ~QGraphicsEffect();
49    virtual QRectF boundingRectFor(const QRectF &sourceRect) const;
50    QRectF boundingRect() const;
51    bool isEnabled() const;
52
53public slots:
54    void setEnabled(bool enable);
55    void update();
56
57signals:
58    void enabledChanged(bool enabled);
59
60protected:
61    virtual void draw(QPainter *painter) = 0;
62    virtual void sourceChanged(QGraphicsEffect::ChangeFlags flags);
63    void updateBoundingRect();
64    bool sourceIsPixmap() const;
65    QRectF sourceBoundingRect(Qt::CoordinateSystem system = Qt::LogicalCoordinates) const;
66    void drawSource(QPainter *painter);
67    QPixmap sourcePixmap(Qt::CoordinateSystem system = Qt::LogicalCoordinates, QPoint *offset /Out/ = 0, QGraphicsEffect::PixmapPadMode mode = QGraphicsEffect::PadToEffectiveBoundingRect) const;
68};
69
70QFlags<QGraphicsEffect::ChangeFlag> operator|(QGraphicsEffect::ChangeFlag f1, QFlags<QGraphicsEffect::ChangeFlag> f2);
71
72class QGraphicsColorizeEffect : QGraphicsEffect
73{
74%TypeHeaderCode
75#include <qgraphicseffect.h>
76%End
77
78public:
79    QGraphicsColorizeEffect(QObject *parent /TransferThis/ = 0);
80    virtual ~QGraphicsColorizeEffect();
81    QColor color() const;
82    qreal strength() const;
83
84public slots:
85    void setColor(const QColor &c);
86    void setStrength(qreal strength);
87
88signals:
89    void colorChanged(const QColor &color);
90    void strengthChanged(qreal strength);
91
92protected:
93    virtual void draw(QPainter *painter);
94};
95
96class QGraphicsBlurEffect : QGraphicsEffect
97{
98%TypeHeaderCode
99#include <qgraphicseffect.h>
100%End
101
102public:
103    enum BlurHint
104    {
105        PerformanceHint,
106        QualityHint,
107        AnimationHint,
108    };
109
110    typedef QFlags<QGraphicsBlurEffect::BlurHint> BlurHints;
111    QGraphicsBlurEffect(QObject *parent /TransferThis/ = 0);
112    virtual ~QGraphicsBlurEffect();
113    virtual QRectF boundingRectFor(const QRectF &rect) const;
114    qreal blurRadius() const;
115    QGraphicsBlurEffect::BlurHints blurHints() const;
116
117public slots:
118    void setBlurRadius(qreal blurRadius);
119    void setBlurHints(QGraphicsBlurEffect::BlurHints hints);
120
121signals:
122    void blurRadiusChanged(qreal blurRadius);
123    void blurHintsChanged(QGraphicsBlurEffect::BlurHints hints /ScopesStripped=1/);
124
125protected:
126    virtual void draw(QPainter *painter);
127};
128
129QFlags<QGraphicsBlurEffect::BlurHint> operator|(QGraphicsBlurEffect::BlurHint f1, QFlags<QGraphicsBlurEffect::BlurHint> f2);
130
131class QGraphicsDropShadowEffect : QGraphicsEffect
132{
133%TypeHeaderCode
134#include <qgraphicseffect.h>
135%End
136
137public:
138    QGraphicsDropShadowEffect(QObject *parent /TransferThis/ = 0);
139    virtual ~QGraphicsDropShadowEffect();
140    virtual QRectF boundingRectFor(const QRectF &rect) const;
141    QPointF offset() const;
142    qreal xOffset() const;
143    qreal yOffset() const;
144    qreal blurRadius() const;
145    QColor color() const;
146
147public slots:
148    void setOffset(const QPointF &ofs);
149    void setOffset(qreal dx, qreal dy);
150    void setOffset(qreal d);
151    void setXOffset(qreal dx);
152    void setYOffset(qreal dy);
153    void setBlurRadius(qreal blurRadius);
154    void setColor(const QColor &color);
155
156signals:
157    void offsetChanged(const QPointF &offset);
158    void blurRadiusChanged(qreal blurRadius);
159    void colorChanged(const QColor &color);
160
161protected:
162    virtual void draw(QPainter *painter);
163};
164
165class QGraphicsOpacityEffect : QGraphicsEffect
166{
167%TypeHeaderCode
168#include <qgraphicseffect.h>
169%End
170
171public:
172    QGraphicsOpacityEffect(QObject *parent /TransferThis/ = 0);
173    virtual ~QGraphicsOpacityEffect();
174    qreal opacity() const;
175    QBrush opacityMask() const;
176
177public slots:
178    void setOpacity(qreal opacity);
179    void setOpacityMask(const QBrush &mask);
180
181signals:
182    void opacityChanged(qreal opacity);
183    void opacityMaskChanged(const QBrush &mask);
184
185protected:
186    virtual void draw(QPainter *painter);
187};
188