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
Bases:
enum.IntEnum
alias of
RasterResamplingStage
alias of
RasterPipeInterfaceRole
Methods
Returns the interface at the specified index.
Returns the brightness filter interface, or
None
if no brightness filter is present in the pipe.Returns
True
if the interface at the specified index may be switched on or off.Returns a reference to the pipe's property collection, used for data defined overrides.
Evaluates any data defined properties set on the pipe, applying their results to the corresponding interfaces in place.
Returns the hue/saturation interface, or
None
if no hue/saturation filter is present in the pipe.Attempts to insert interface at specified index and connect if connection would fail, the interface is not inserted and
False
is returnedReturns last interface in the pipe.
Moves the pipe to another
thread
.Returns the raster nuller interface, or
None
if no raster nuller is present in the pipe.Returns the projector interface, or
None
if no projector is present in the pipe.Returns the definitions for data defined properties available for use in raster pipes.
Returns the data provider interface, or
None
if no data provider is present in the pipe.Removes and deletes the interface at given index (if possible).
Returns the raster renderer interface, or
None
if no raster renderer is present in the pipe.Attempts to replace the interface at specified index and reconnect the pipe.
Returns the resample filter interface, or
None
if no resample filter is present in the pipe.Returns which stage of the pipe should apply resampling
Inserts a new known interface in default place or replace interface of the same role if it already exists.
Sets the pipe's property
collection
, used for data defined overrides.Set whether the interface at the specified index is enabled.
Sets which stage of the pipe should apply resampling.
Returns the size of the pipe (the number of interfaces contained in the pipe).
- class Property(value)¶
Bases:
enum.IntEnum
Data definable properties.
New in version 3.22.
RendererOpacity
: Raster renderer global opacity
- 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:
- brightnessFilter(self) QgsBrightnessContrastFilter ¶
Returns the brightness filter interface, or
None
if no brightness filter is present in the pipe.- Return type:
- 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.
See also
New in version 3.22.
- Return type:
- 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:
- 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 returnedSee also
See also
- Parameters:
idx (int) –
interface (QgsRasterInterface) –
- Return type:
bool
- last(self) QgsRasterInterface ¶
Returns last interface in the pipe.
- Return type:
- 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:
- projector(self) QgsRasterProjector ¶
Returns the projector interface, or
None
if no projector is present in the pipe.- Return type:
- 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:
- 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:
- 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
See also
- Parameters:
idx (int) –
interface (QgsRasterInterface) –
- Return type:
bool
- resampleFilter(self) QgsRasterResampleFilter ¶
Returns the resample filter interface, or
None
if no resample filter is present in the pipe.- Return type:
- resamplingStage(self) Qgis.RasterResamplingStage ¶
Returns which stage of the pipe should apply resampling
See also
New in version 3.16.
- Return type:
- 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
See also
- 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
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()
.See also
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