Class: QgsRasterPipe

class qgis.core.QgsRasterPipe

Bases: sip.wrapper

Contains a pipeline of raster interfaces for sequential raster processing.

QgsRasterPipe() Constructor for an empty QgsRasterPipe.

Enums

ResamplingStage

alias of RasterResamplingStage

Role

alias of RasterPipeInterfaceRole

Methods

at

Returns the interface at the specified index.

brightnessFilter

Returns the brightness filter interface, or None if no brightness filter is present in the pipe.

canSetOn

Returns True if the interface at the specified index may be switched on or off.

dataDefinedProperties

Returns a reference to the pipe's property collection, used for data defined overrides.

evaluateDataDefinedProperties

Evaluates any data defined properties set on the pipe, applying their results to the corresponding interfaces in place.

hueSaturationFilter

Returns the hue/saturation interface, or None if no hue/saturation filter is present in the pipe.

insert

Attempts to insert interface at specified index and connect if connection would fail, the interface is not inserted and False is returned

last

Returns last interface in the pipe.

moveToThread

Moves the pipe to another thread.

nuller

Returns the raster nuller interface, or None if no raster nuller is present in the pipe.

projector

Returns the projector interface, or None if no projector is present in the pipe.

propertyDefinitions

Returns the definitions for data defined properties available for use in raster pipes.

provider

Returns the data provider interface, or None if no data provider is present in the pipe.

remove

Removes and deletes the interface at given index (if possible).

renderer

Returns the raster renderer interface, or None if no raster renderer is present in the pipe.

replace

Attempts to replace the interface at specified index and reconnect the pipe.

resampleFilter

Returns the resample filter interface, or None if no resample filter is present in the pipe.

resamplingStage

Returns which stage of the pipe should apply resampling

set

Inserts a new known interface in default place or replace interface of the same role if it already exists.

setDataDefinedProperties

Sets the pipe's property collection, used for data defined overrides.

setOn

Set whether the interface at the specified index is enabled.

setResamplingStage

Sets which stage of the pipe should apply resampling.

size

Returns the size of the pipe (the number of interfaces contained in the pipe).

Attributes

RendererOpacity

class Property

Bases: int

RendererOpacity = 0
ResamplingStage

alias of RasterResamplingStage

Role

alias of RasterPipeInterfaceRole

at(self, idx: int) QgsRasterInterface

Returns the interface at the specified index.

Parameters:

idx (int) –

Return type:

QgsRasterInterface

brightnessFilter(self) QgsBrightnessContrastFilter

Returns the brightness filter interface, or None if no brightness filter is present in the pipe.

Return type:

QgsBrightnessContrastFilter

canSetOn(self, idx: int, on: bool) bool

Returns True if the interface at the specified index may be switched on or off.

Parameters:
  • idx (int) –

  • on (bool) –

Return type:

bool

dataDefinedProperties(self) QgsPropertyCollection

Returns a reference to the pipe’s property collection, used for data defined overrides.

New in version 3.22.

Return type:

QgsPropertyCollection

evaluateDataDefinedProperties(self, context: QgsExpressionContext)

Evaluates any data defined properties set on the pipe, applying their results to the corresponding interfaces in place.

New in version 3.22.

Parameters:

context (QgsExpressionContext) –

hueSaturationFilter(self) QgsHueSaturationFilter

Returns the hue/saturation interface, or None if no hue/saturation filter is present in the pipe.

Return type:

QgsHueSaturationFilter

insert(self, idx: int, interface: QgsRasterInterface) bool

Attempts to insert interface at specified index and connect if connection would fail, the interface is not inserted and False is returned

See also

set()

See also

replace()

Parameters:
Return type:

bool

last(self) QgsRasterInterface

Returns last interface in the pipe.

Return type:

QgsRasterInterface

moveToThread(self, thread: QThread)

Moves the pipe to another thread.

This effects all QObject derived interfaces in the pipe, and follows the same behavior as QObject.moveToThread. Specifically, it is permitted to PUSH the pipe from the current thread to another thread, but NOT to PULL a pipe from another thread over to the current thread. Pulling is only supported by first pushsing the pipe from its current thread to a None thread, and then later pulling to the current thread. See QObject documentation for more details.

New in version 3.30.

Parameters:

thread (QThread) –

nuller(self) QgsRasterNuller

Returns the raster nuller interface, or None if no raster nuller is present in the pipe.

Return type:

QgsRasterNuller

projector(self) QgsRasterProjector

Returns the projector interface, or None if no projector is present in the pipe.

Return type:

QgsRasterProjector

propertyDefinitions() Dict[int, QgsPropertyDefinition]

Returns the definitions for data defined properties available for use in raster pipes.

New in version 3.22.

Return type:

Dict[int, QgsPropertyDefinition]

provider(self) QgsRasterDataProvider

Returns the data provider interface, or None if no data provider is present in the pipe.

Return type:

QgsRasterDataProvider

remove(self, idx: int) bool

Removes and deletes the interface at given index (if possible).

Returns True if the interface was successfully removed.

remove(self, interface: QgsRasterInterface) -> bool Removes and deletes interface from pipe (if possible).

Returns True if the interface was successfully removed.

Parameters:

idx (int) –

Return type:

bool

renderer(self) QgsRasterRenderer

Returns the raster renderer interface, or None if no raster renderer is present in the pipe.

Return type:

QgsRasterRenderer

replace(self, idx: int, interface: QgsRasterInterface) bool

Attempts to replace the interface at specified index and reconnect the pipe.

If the connection would fail, the interface is not inserted and False is returned.

See also

insert()

See also

set()

Parameters:
Return type:

bool

resampleFilter(self) QgsRasterResampleFilter

Returns the resample filter interface, or None if no resample filter is present in the pipe.

Return type:

QgsRasterResampleFilter

resamplingStage(self) Qgis.RasterResamplingStage

Returns which stage of the pipe should apply resampling

New in version 3.16.

Return type:

Qgis.RasterResamplingStage

set(self, interface: QgsRasterInterface) bool

Inserts a new known interface in default place or replace interface of the same role if it already exists.

Known interfaces are:

(and their subclasses).

For other interfaces the position of the interface in the pipe must be explicitly specified using the insert() method.

See also

insert()

See also

replace()

Parameters:

interface (QgsRasterInterface) –

Return type:

bool

setDataDefinedProperties(self, collection: QgsPropertyCollection)

Sets the pipe’s property collection, used for data defined overrides.

Any existing properties will be discarded.

See also

Property

New in version 3.22.

Parameters:

collection (QgsPropertyCollection) –

setOn(self, idx: int, on: bool) bool

Set whether the interface at the specified index is enabled.

Returns True on success.

Parameters:
  • idx (int) –

  • on (bool) –

Return type:

bool

setResamplingStage(self, stage: Qgis.RasterResamplingStage)

Sets which stage of the pipe should apply resampling.

Provider resampling is only supported if provider sets ProviderHintCanPerformProviderResampling in providerCapabilities().

New in version 3.16.

Parameters:

stage (Qgis.RasterResamplingStage) –

size(self) int

Returns the size of the pipe (the number of interfaces contained in the pipe).

Return type:

int