Class: QgsBlurEffect

A paint effect which blurs a source picture, using a number of different blur methods.

Class Hierarchy

Inheritance diagram of qgis.core.QgsBlurEffect

Base classes

QgsPaintEffect

Base class for visual effects which can be applied to QPicture drawings.

Methods

blendMode

Returns the blend mode for the effect

blurLevel

Returns the blur level (radius)

blurMapUnitScale

Returns the map unit scale used for the blur strength (radius).

blurMethod

Returns the blur method (algorithm) used for performing the blur.

blurUnit

Returns the units used for the blur level (radius).

opacity

Returns the opacity for the effect.

setBlendMode

Sets the blend mode for the effect

setBlurLevel

Sets blur level (radius)

setBlurMapUnitScale

Sets the map unit scale used for the blur strength (radius).

setBlurMethod

Sets the blur method (algorithm) to use for performing the blur.

setBlurUnit

Sets the units used for the blur level (radius).

setOpacity

Sets the opacity for the effect.

Static Methods

create

Creates a new QgsBlurEffect effect from a properties string map.

Attributes

GaussianBlur

StackBlur

class qgis.core.QgsBlurEffect[source]

Bases: QgsPaintEffect

class BlurMethod

Bases: int

GaussianBlur = 1
StackBlur = 0
blendMode(self) QPainter.CompositionMode[source]

Returns the blend mode for the effect

Return type:

QPainter.CompositionMode

Returns:

blend mode used for drawing the effect on to a destination paint device

See also

setBlendMode()

blurLevel(self) float[source]

Returns the blur level (radius)

Return type:

float

Returns:

blur level. Depending on the current blurMethod(), this parameter has different effects

See also

setBlurLevel()

See also

blurUnit()

See also

blurMethod()

blurMapUnitScale(self) QgsMapUnitScale

Returns the map unit scale used for the blur strength (radius).

Return type:

QgsMapUnitScale

Returns:

map unit scale for blur strength

See also

blurLevel()

See also

blurUnit()

Added in version 3.4.9.

blurMethod(self) QgsBlurEffect.BlurMethod[source]

Returns the blur method (algorithm) used for performing the blur.

Return type:

QgsBlurEffect.BlurMethod

Returns:

blur method

See also

setBlurMethod()

blurUnit(self) Qgis.RenderUnit[source]

Returns the units used for the blur level (radius).

Return type:

Qgis.RenderUnit

Returns:

units for blur level

See also

setBlurUnit()

See also

blurLevel()

Added in version 3.4.9.

static create(map: Dict[str, Any]) QgsPaintEffect | None[source]

Creates a new QgsBlurEffect effect from a properties string map.

Parameters:

map (Dict[str, Any]) – encoded properties string map

Return type:

Optional[QgsPaintEffect]

Returns:

new QgsBlurEffect

opacity(self) float[source]

Returns the opacity for the effect.

Return type:

float

Returns:

opacity value between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque

See also

setOpacity()

setBlendMode(self, mode: QPainter.CompositionMode)[source]

Sets the blend mode for the effect

Parameters:

mode (QPainter.CompositionMode) – blend mode used for drawing the effect on to a destination paint device

See also

blendMode()

setBlurLevel(self, level: float)[source]

Sets blur level (radius)

Parameters:

level (float) – blur level. Depending on the current blurMethod(), this parameter has different effects

See also

blurLevel()

See also

setBlurUnit()

See also

setBlurMethod()

setBlurMapUnitScale(self, scale: QgsMapUnitScale)[source]

Sets the map unit scale used for the blur strength (radius).

Parameters:

scale (QgsMapUnitScale) – map unit scale for blur strength

See also

setBlurLevel()

See also

setBlurUnit()

Added in version 3.4.9.

setBlurMethod(self, method: QgsBlurEffect.BlurMethod)[source]

Sets the blur method (algorithm) to use for performing the blur.

Parameters:

method (QgsBlurEffect.BlurMethod) – blur method

See also

blurMethod()

setBlurUnit(self, unit: Qgis.RenderUnit)[source]

Sets the units used for the blur level (radius).

Parameters:

unit (Qgis.RenderUnit) – units for blur level

See also

blurUnit()

See also

setBlurLevel()

Added in version 3.4.9.

setOpacity(self, opacity: float)[source]

Sets the opacity for the effect.

Parameters:

opacity (float) – double between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque

See also

opacity()