QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
17 #ifndef QGSBLUREFFECT_H
18 #define QGSBLUREFFECT_H
20 #include "qgis_core.h"
58 QString
type()
const override {
return QStringLiteral(
"blur" ); }
72 void setBlurLevel( const
double level ) { mBlurLevel = level; }
145 void setOpacity(
const double opacity ) { mOpacity = opacity; }
161 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
169 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
178 double mBlurLevel = 2.645;
181 BlurMethod mBlurMethod = StackBlur;
182 double mOpacity = 1.0;
183 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
190 #endif // QGSBLUREFFECT_H
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
RenderUnit
Rendering size units.
A paint effect which blurs a source picture, using a number of different blur methods.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
void setBlurUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the blur level (radius).
virtual QgsStringMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
Contains information about the context of a rendering operation.
@ RenderMillimeters
Millimeters.
QString type() const override
Returns the effect type.
void setOpacity(const double opacity)
Sets the opacity for the effect.
BlurMethod
Available blur methods (algorithms)
@ StackBlur
Stack blur, a fast but low quality blur. Valid blur level values are between 0 - 16.
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of 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...
virtual QRectF boundingRect(const QRectF &rect, const QgsRenderContext &context) const
Returns the bounding rect required for drawing the effect.
Struct for storing maximum and minimum scales for measurements in map units.
double blurLevel() const
Returns the blur level (radius)
#define SIP_NODEFAULTCTORS
QMap< QString, QString > QgsStringMap
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the blur strength (radius).
BlurMethod blurMethod() const
Returns the blur method (algorithm) used for performing the blur.
Base class for visual effects which can be applied to QPicture drawings.
QgsBlurEffect()=default
Constructor for QgsBlurEffect.
double opacity() const
Returns the opacity for the effect.
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the blur strength (radius).
QgsUnitTypes::RenderUnit blurUnit() const
Returns the units used for the blur level (radius).
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
void setBlurMethod(const BlurMethod method)
Sets the blur method (algorithm) to use for performing the blur.