Class: QgsSingleBandPseudoColorRenderer

Raster renderer pipe for single band pseudocolor.

Class Hierarchy

Inheritance diagram of qgis.core.QgsSingleBandPseudoColorRenderer

Base classes

QgsRasterRenderer

Raster renderer pipe that applies colors to a raster.

QgsRasterInterface

Base class for processing filters like renderers, reprojector, resampler etc.

Methods

band

Returns the band used by the renderer

classificationMax

classificationMin

constShader

Returns the raster shader

createShader

Creates a color ramp shader

setBand

Sets the band used by the renderer.

setClassificationMax

setClassificationMin

setShader

Takes ownership of the shader

shader

Returns the raster shader

Static Methods

create

class qgis.core.QgsSingleBandPseudoColorRenderer[source]

Bases: QgsRasterRenderer

__init__(input: QgsRasterInterface | None, band: int = -1, shader: QgsRasterShader | None = None)

Note: takes ownership of QgsRasterShader

Parameters:
band(self) int[source]

Returns the band used by the renderer

Deprecated since version 3.38: Use inputBand() instead.

Return type:

int

classificationMax(self) float[source]
Return type:

float

classificationMin(self) float[source]
Return type:

float

constShader(self) QgsRasterShader | None

Returns the raster shader

Return type:

Optional[QgsRasterShader]

static create(elem: QDomElement, input: QgsRasterInterface | None) QgsRasterRenderer | None[source]
Parameters:
Return type:

Optional[QgsRasterRenderer]

createShader(self, colorRamp: QgsColorRamp | None = None, colorRampType: Qgis.ShaderInterpolationMethod = Qgis.ShaderInterpolationMethod.Linear, classificationMode: Qgis.ShaderClassificationMethod = Qgis.ShaderClassificationMethod.Continuous, classes: int = 0, clip: bool = False, extent: QgsRectangle = QgsRectangle())[source]

Creates a color ramp shader

Parameters:
  • colorRamp (Optional[QgsColorRamp] = None) – vector color ramp. Ownership is transferred to the shader.

  • colorRampType (Qgis.ShaderInterpolationMethod = Qgis.ShaderInterpolationMethod.Linear) – type of color ramp shader

  • classificationMode (Qgis.ShaderClassificationMethod = Qgis.ShaderClassificationMethod.Continuous) – classification mode

  • classes (int = 0) – number of classes

  • clip (bool = False) – clip out of range values

  • extent (QgsRectangle = QgsRectangle()) – extent used in classification (only used in quantile mode)

setBand(self, bandNo: int)[source]

Sets the band used by the renderer.

See also

band()

Deprecated since version 3.38: Use setInputBand() instead.

Parameters:

bandNo (int)

setClassificationMax(self, max: float)[source]
Parameters:

max (float)

setClassificationMin(self, min: float)[source]
Parameters:

min (float)

setShader(self, shader: QgsRasterShader | None)[source]

Takes ownership of the shader

Parameters:

shader (Optional[QgsRasterShader])

shader(self) QgsRasterShader | None[source]

Returns the raster shader

Return type:

Optional[QgsRasterShader]