17 #ifndef QGSGLOWEFFECT_H 18 #define QGSGLOWEFFECT_H 20 #include "qgis_core.h" 64 void setSpread(
const double spread ) { mSpread = spread; }
73 double spread()
const {
return mSpread; }
176 void setOpacity(
const double opacity ) { mOpacity = opacity; }
194 void setColor(
const QColor &color ) { mColor = color; }
204 QColor
color()
const {
return mColor; }
230 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
238 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
274 virtual bool shadeExterior()
const = 0;
276 double mSpread = 2.0;
280 double mBlurLevel = 2.645;
283 double mOpacity = 0.5;
285 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
313 QString
type()
const override {
return QStringLiteral(
"outerGlow" ); }
345 QString
type()
const override {
return QStringLiteral(
"innerGlow" ); }
354 #endif // QGSGLOWEFFECT_H virtual QgsStringMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
virtual QRectF boundingRect(const QRectF &rect, const QgsRenderContext &context) const
Returns the bounding rect required for drawing the effect.
bool shadeExterior() const override
Specifies whether the glow is drawn outside the picture or within the picture.
Abstract base class for color ramps.
Base class for visual effects which can be applied to QPicture drawings.
void setBlurUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the glow blur level (radius).
QMap< QString, QString > QgsStringMap
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
Base class for paint effect which draw a glow inside or outside a picture.
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the glow blur strength (radius).
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
void setSpreadMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the spread distance.
double spread() const
Returns the spread distance used for drawing the glow effect.
QString type() const override
Returns the effect type.
void setSpreadUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the glow spread distance.
void setColorType(GlowColorType colorType)
Sets the color mode to use for the glow.
void setBlurLevel(const double level)
Sets blur level (radius) for the glow.
QString type() const override
Returns the effect type.
double blurLevel() const
Returns the blur level (radius) for the glow.
QgsUnitTypes::RenderUnit spreadUnit() const
Returns the units used for the glow spread distance.
GlowColorType
Color sources for the glow.
void setSpread(const double spread)
Sets the spread distance for drawing the glow effect.
const QgsMapUnitScale & spreadMapUnitScale() const
Returns the map unit scale used for the spread distance.
A paint effect which draws a glow outside of a picture.
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...
void setOpacity(const double opacity)
Sets the opacity for the effect.
Use a single color and fade the color to totally transparent.
Contains information about the context of a rendering operation.
Struct for storing maximum and minimum scales for measurements in map units.
QgsMapUnitScale mSpreadMapUnitScale
QColor color() const
Returns the color for the glow.
QgsUnitTypes::RenderUnit blurUnit() const
Returns the units used for the glow blur level (radius).
GlowColorType colorType() const
Returns the color mode used for the glow.
double opacity() const
Returns the opacity for the effect.
QgsMapUnitScale mBlurMapUnitScale
QgsColorRamp * ramp() const
Returns the color ramp used for the glow.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
A paint effect which draws a glow within a picture.
void setColor(const QColor &color)
Sets the color for the glow.
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the glow blur strength (radius).
RenderUnit
Rendering size units.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
bool shadeExterior() const override
Specifies whether the glow is drawn outside the picture or within the picture.