17#ifndef QGSGLOWEFFECT_H
18#define QGSGLOWEFFECT_H
63 void setSpread(
const double spread ) { mSpread = spread; }
72 double spread()
const {
return mSpread; }
175 void setOpacity(
const double opacity ) { mOpacity = opacity; }
193 void setColor(
const QColor &color ) { mColor = color; }
203 QColor
color()
const {
return mColor; }
229 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
237 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
275 double mSpread = 2.0;
279 double mBlurLevel = 2.645;
282 double mOpacity = 0.5;
284 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
311 QString
type()
const override {
return QStringLiteral(
"outerGlow" ); }
316 bool shadeExterior()
const override {
return true; }
342 QString
type()
const override {
return QStringLiteral(
"innerGlow" ); }
347 bool shadeExterior()
const override {
return false; }
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
Abstract base class for color ramps.
Base class for paint effect which draw a glow inside or outside a picture.
void setSpread(const double spread)
Sets the spread distance for drawing the glow effect.
void setColorType(GlowColorType colorType)
Sets the color mode to use for the glow.
void setSpreadMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the spread distance.
Qgis::RenderUnit blurUnit() const
Returns the units used for the glow blur level (radius).
void setOpacity(const double opacity)
Sets the opacity for the effect.
QgsMapUnitScale mBlurMapUnitScale
double spread() const
Returns the spread distance used for drawing the glow effect.
virtual bool shadeExterior() const =0
Specifies whether the glow is drawn outside the picture or within the picture.
const QgsMapUnitScale & spreadMapUnitScale() const
Returns the map unit scale used for the spread distance.
GlowColorType
Color sources for the glow.
@ SingleColor
Use a single color and fade the color to totally transparent.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
double blurLevel() const
Returns the blur level (radius) for the glow.
double opacity() const
Returns the opacity for the effect.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
QColor color() const
Returns the color for the glow.
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the glow blur strength (radius).
void setBlurUnit(const Qgis::RenderUnit unit)
Sets the units used for the glow blur level (radius).
void setBlurLevel(const double level)
Sets blur level (radius) for the glow.
QgsColorRamp * ramp() const
Returns the color ramp used for the glow.
Qgis::RenderUnit spreadUnit() const
Returns the units used for the glow spread distance.
QgsMapUnitScale mSpreadMapUnitScale
void setSpreadUnit(const Qgis::RenderUnit unit)
Sets the units used for the glow spread distance.
void setColor(const QColor &color)
Sets the color for the glow.
GlowColorType colorType() const
Returns the color mode used for the glow.
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the glow blur strength (radius).
A paint effect which draws a glow within a picture.
QString type() const override
Returns the effect type.
Struct for storing maximum and minimum scales for measurements in map units.
A paint effect which draws a glow outside of a picture.
QString type() const override
Returns the effect type.
Base class for visual effects which can be applied to QPicture drawings.
virtual void readProperties(const QVariantMap &props)=0
Reads a string map of an effect's properties and restores the effect to the state described by the pr...
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
virtual QRectF boundingRect(const QRectF &rect, const QgsRenderContext &context) const
Returns the bounding rect required for drawing the effect.
virtual QVariantMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
Contains information about the context of a rendering operation.