17 #ifndef QGSPAINTEFFECT_H 18 #define QGSPAINTEFFECT_H 23 #include <QDomDocument> 24 #include <QDomElement> 72 virtual QString type()
const = 0;
92 virtual void readProperties(
const QgsStringMap& props ) = 0;
109 virtual bool readProperties(
const QDomElement& element );
144 void setEnabled(
const bool enabled );
158 void setDrawMode(
const DrawMode drawMode );
180 void drawSource(
QPainter& painter );
225 void fixQPictureDpi(
QPainter* painter )
const;
292 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
299 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
307 double mTransparency;
308 QPainter::CompositionMode mBlendMode;
311 #endif // QGSPAINTEFFECT_H virtual QgsStringMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
Base class for visual effects which can be applied to QPicture drawings.
DrawMode drawMode() const
Returns the draw mode for the effect.
double transparency() const
Returns the transparency for the effect.
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
void setTransparency(const double transparency)
Sets the transparency for the effect.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
A paint effect which consists of a stack of other chained paint effects.
bool enabled() const
Returns whether the effect is enabled.
bool requiresQPainterDpiFix
DrawMode
Drawing modes for effects.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
virtual void readProperties(const QgsStringMap &props)=0
Reads a string map of an effect's properties and restores the effect to the state described by the pr...
Contains information about the context of a rendering operation.
const QPicture * source() const
Returns the source QPicture.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
virtual QString type() const override
Returns the effect type.
A paint effect which draws the source picture with minor or no alterations.