Class: QgsColorEffect¶
-
class
qgis.core.
QgsColorEffect
¶ Bases:
qgis._core.QgsPaintEffect
A paint effect which alters the colors (e.g., brightness, contrast) in a source picture.
New in version 2.9: Enums
Methods
Returns the blend mode for the effect
Returns the brightness modification for the effect.
Returns the color used for colorizing a picture.
Returns whether the effect will colorize a picture.
Returns the strength used for colorizing a picture.
Returns the contrast modification for the effect.
Creates a new QgsColorEffect effect from a properties string map.
Returns whether the effect will convert a picture to grayscale.
Returns the opacity for the effect.
Returns the saturation modification for the effect.
Sets the blend mode for the effect
Sets the brightness modification for the effect.
Sets the color used for colorizing a picture.
Sets whether the effect should colorize a picture.
Sets the strength for colorizing a picture.
Sets the contrast modification for the effect.
Sets whether the effect should convert a picture to grayscale.
Sets the
opacity
for the effect.Sets the saturation modification for the effect.
Signals
Attributes
-
blendMode
(self) → QPainter.CompositionMode¶ Returns the blend mode for the effect
- Returns
blend mode used for drawing the effect on to a destination paint device
See also
-
boundingRect
()¶
-
brightness
(self) → int¶ Returns the brightness modification for the effect.
- Returns
brightness value. Values are between -255 and 255, where 0 represents no change, negative values indicate darkening and positive values indicate lightening
See also
-
clone
(self) → QgsColorEffect¶
-
colorizeColor
(self) → QColor¶ Returns the color used for colorizing a picture. This is only used if colorizeOn() is set to true.
- Returns
colorization color
See also
See also
See also
-
colorizeOn
(self) → bool¶ Returns whether the effect will colorize a picture.
- Returns
true if colorization is enableds
See also
See also
See also
-
colorizeStrength
(self) → int¶ Returns the strength used for colorizing a picture. This is only used if setColorizeOn() is set to true.
- Returns
colorization strength, between 0 and 100
See also
See also
See also
-
contrast
(self) → int¶ Returns the contrast modification for the effect.
- Returns
contrast value. Values are between -100 and 100, where 0 represents no change, negative values indicate less contrast and positive values indicate greater contrast
See also
-
create
(map: Dict[str, str]) → QgsPaintEffect¶ Creates a new QgsColorEffect effect from a properties string map.
- Parameters
map – encoded properties string map
- Returns
new QgsColorEffect
-
draw
(self, context: QgsRenderContext)¶
-
drawSource
()¶
-
fixQPictureDpi
()¶
-
grayscaleMode
(self) → QgsImageOperation.GrayscaleMode¶ Returns whether the effect will convert a picture to grayscale.
- Returns
method for grayscale conversion
See also
-
imageOffset
()¶
-
opacity
(self) → float¶ Returns the opacity for the effect.
- Returns
opacity value between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque.
See also
-
properties
(self) → Dict[str, str]¶
-
readProperties
(self, props: Dict[str, str])¶
-
saturation
(self) → float¶ Returns the saturation modification for the effect.
- Returns
saturation value. Values are between 0 and 2.0, where 1.0 represents no change, 0.0 represents totally desaturated (grayscale), and positive values indicate greater saturation
See also
-
setBlendMode
(self, mode: QPainter.CompositionMode)¶ Sets the blend mode for the effect
- Parameters
mode – blend mode used for drawing the effect on to a destination paint device
See also
-
setBrightness
(self, brightness: int)¶ Sets the brightness modification for the effect.
- Parameters
brightness – Valid values are between -255 and 255, where 0 represents no change, negative values indicate darkening and positive values indicate lightening
See also
-
setColorizeColor
(self, colorizeColor: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the color used for colorizing a picture. This is only used if setColorizeOn() is set to true.
- Parameters
colorizeColor – colorization color
See also
See also
See also
-
setColorizeOn
(self, colorizeOn: bool)¶ Sets whether the effect should colorize a picture.
- Parameters
colorizeOn – set to true to enable colorization
See also
See also
See also
-
setColorizeStrength
(self, colorizeStrength: int)¶ Sets the strength for colorizing a picture. This is only used if setColorizeOn() is set to true.
- Parameters
colorizeStrength – colorization strength, between 0 and 100
See also
See also
See also
-
setContrast
(self, contrast: int)¶ Sets the contrast modification for the effect.
- Parameters
contrast – Valid values are between -100 and 100, where 0 represents no change, negative values indicate less contrast and positive values indicate greater contrast
See also
-
setGrayscaleMode
(self, grayscaleMode: QgsImageOperation.GrayscaleMode)¶ Sets whether the effect should convert a picture to grayscale.
- Parameters
grayscaleMode – method for grayscale conversion
See also
-
setOpacity
(self, opacity: float)¶ Sets the
opacity
for the effect.- Parameters
opacity – double between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque
See also
-
setSaturation
(self, saturation: float)¶ Sets the saturation modification for the effect.
- Parameters
saturation – Valid values are between 0 and 2.0, where 1.0 represents no change, 0.0 represents totally desaturated (grayscale), and positive values indicate greater saturation
See also
-
source
()¶
-
sourceAsImage
()¶
-
type
(self) → str¶
-