QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
17 #ifndef QGSGLOWEFFECT_H
18 #define QGSGLOWEFFECT_H
20 #include "qgis_core.h"
65 void setSpread(
const double spread ) { mSpread = spread; }
74 double spread()
const {
return mSpread; }
177 void setOpacity(
const double opacity ) { mOpacity = opacity; }
195 void setColor(
const QColor &color ) { mColor = color; }
205 QColor
color()
const {
return mColor; }
231 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
239 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
275 virtual bool shadeExterior()
const = 0;
277 double mSpread = 2.0;
281 double mBlurLevel = 2.645;
284 double mOpacity = 0.5;
286 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
314 QString
type()
const override {
return QStringLiteral(
"outerGlow" ); }
319 bool shadeExterior()
const override {
return true; }
346 QString
type()
const override {
return QStringLiteral(
"innerGlow" ); }
351 bool shadeExterior()
const override {
return false; }
355 #endif // QGSGLOWEFFECT_H
Abstract base class for color ramps.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
const QgsMapUnitScale & blurMapUnitScale() const
Returns the map unit scale used for the glow blur strength (radius).
void setSpreadMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the spread distance.
RenderUnit
Rendering size units.
QgsMapUnitScale mBlurMapUnitScale
QColor color() const
Returns the color for the glow.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
void setBlurLevel(const double level)
Sets blur level (radius) for the glow.
Contains information about the context of a rendering operation.
@ RenderMillimeters
Millimeters.
void setOpacity(const double opacity)
Sets the opacity for the effect.
QgsUnitTypes::RenderUnit blurUnit() const
Returns the units used for the glow blur level (radius).
Base class for paint effect which draw a glow inside or outside a picture.
const QgsMapUnitScale & spreadMapUnitScale() const
Returns the map unit scale used for the spread distance.
void setBlurUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the glow blur level (radius).
void setSpreadUnit(const QgsUnitTypes::RenderUnit unit)
Sets the units used for the glow spread distance.
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
double blurLevel() const
Returns the blur level (radius) for the glow.
virtual QRectF boundingRect(const QRectF &rect, const QgsRenderContext &context) const
Returns the bounding rect required for drawing the effect.
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...
Struct for storing maximum and minimum scales for measurements in map units.
void setColor(const QColor &color)
Sets the color for the glow.
QgsColorRamp * ramp() const
Returns the color ramp used for the glow.
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.
A paint effect which draws a glow within a picture.
QString type() const override
Returns the effect type.
GlowColorType colorType() const
Returns the color mode used for the glow.
Base class for visual effects which can be applied to QPicture drawings.
A paint effect which draws a glow outside of a picture.
double opacity() const
Returns the opacity for the effect.
QgsMapUnitScale mSpreadMapUnitScale
GlowColorType
Color sources for the glow.
virtual QVariantMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
QString type() const override
Returns the effect type.
double spread() const
Returns the spread distance used for drawing the glow effect.
@ SingleColor
Use a single color and fade the color to totally transparent.
QgsUnitTypes::RenderUnit spreadUnit() const
Returns the units used for the glow spread distance.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
void setBlurMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for the glow blur strength (radius).