17 #ifndef QGSCOLOREFFECT_H 18 #define QGSCOLOREFFECT_H 58 void setBrightness(
int brightness ) { mBrightness = qBound( -255, brightness, 255 ); }
74 void setContrast(
int contrast ) { mContrast = qBound( -100, contrast, 100 ); }
135 void setColorizeColor(
const QColor& colorizeColor );
183 void setBlendMode(
const QPainter::CompositionMode mode ) { mBlendMode = mode; }
190 QPainter::CompositionMode
blendMode()
const {
return mBlendMode; }
198 double mTransparency;
199 QPainter::CompositionMode mBlendMode;
206 int mColorizeStrength;
209 #endif // QGSBLUREFFECT_H virtual QgsStringMap properties() const =0
Returns the properties describing the paint effect encoded in a string format.
void setTransparency(const double transparency)
Sets the transparency for the effect.
Base class for visual effects which can be applied to QPicture drawings.
void setColorizeStrength(int colorizeStrength)
Sets the strength for colorizing a picture.
virtual QgsPaintEffect * clone() const =0
Duplicates an effect by creating a deep copy of the effect.
void setGrayscaleMode(QgsImageOperation::GrayscaleMode grayscaleMode)
Sets whether the effect should convert a picture to grayscale.
void setBrightness(int brightness)
Sets the brightness modification for the effect.
virtual QString type() const override
Returns the effect type.
void setColorizeOn(bool colorizeOn)
Sets whether the effect should colorize a picture.
void setContrast(int contrast)
Sets the contrast modification for the effect.
QgsImageOperation::GrayscaleMode grayscaleMode() const
Returns whether the effect will convert a picture to grayscale.
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...
QPainter::CompositionMode blendMode() const
Returns the blend mode for the effect.
Contains information about the context of a rendering operation.
void setSaturation(double saturation)
Sets the saturation modification for the effect.
int colorizeStrength() const
Returns the strength used for colorizing a picture.
double saturation() const
Returns the saturation modification for the effect.
A paint effect which alters the colors (eg brightness, contrast) in a source picture.
void setBlendMode(const QPainter::CompositionMode mode)
Sets the blend mode for the effect.
virtual void draw(QgsRenderContext &context)=0
Handles drawing of the effect's result on to the specified render context.
double transparency() const
Returns the transparency for the effect.
GrayscaleMode
Modes for converting a QImage to grayscale.
bool colorizeOn() const
Returns whether the effect will colorize a picture.
int contrast() const
Returns the contrast modification for the effect.
QColor colorizeColor() const
Returns the color used for colorizing a picture.
int brightness() const
Returns the brightness modification for the effect.