17#ifndef QGSCOLOREFFECT_H
18#define QGSCOLOREFFECT_H
50 QString
type()
const override {
return QStringLiteral(
"color" ); }
62 void setBrightness(
int brightness );
80 void setContrast(
int contrast );
149 void setColorizeColor(
const QColor &colorizeColor );
203 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
211 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
219 double mOpacity = 1.0;
220 QPainter::CompositionMode mBlendMode = QPainter::CompositionMode_SourceOver;
223 double mSaturation = 1.0;
225 bool mColorizeOn =
false;
226 QColor mColorizeColor;
227 int mColorizeStrength = 100;
QFlags< PaintEffectFlag > PaintEffectFlags
Flags which control how paint effects behave.
A paint effect which alters the colors (e.g., brightness, contrast) in a source picture.
bool colorizeOn() const
Returns whether the effect will colorize a picture.
QgsImageOperation::GrayscaleMode grayscaleMode() const
Returns whether the effect will convert a picture to grayscale.
double opacity() const
Returns the opacity for the effect.
void setOpacity(const double opacity)
Sets the opacity for the effect.
QString type() const override
Returns the effect type.
void setSaturation(double saturation)
Sets the saturation modification for the effect.
void setColorizeStrength(int colorizeStrength)
Sets the strength for colorizing a picture.
int colorizeStrength() const
Returns the strength used for colorizing a picture.
void setColorizeOn(bool colorizeOn)
Sets whether the effect should colorize a picture.
static QgsPaintEffect * create(const QVariantMap &map)
Creates a new QgsColorEffect effect from a properties string map.
int contrast() const
Returns the contrast modification for the effect.
int brightness() const
Returns the brightness modification for the effect.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
double saturation() const
Returns the saturation modification for the effect.
QColor colorizeColor() const
Returns the color used for colorizing a picture.
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
void setGrayscaleMode(QgsImageOperation::GrayscaleMode grayscaleMode)
Sets whether the effect should convert a picture to grayscale.
GrayscaleMode
Modes for converting a QImage to grayscale.
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 Qgis::PaintEffectFlags flags() const
Returns flags which specify how the paint effect behaves.
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of 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.
#define SIP_NODEFAULTCTORS