Class: QgsSingleBandPseudoColorRenderer

class qgis.core.QgsSingleBandPseudoColorRenderer(input: QgsRasterInterface, band: int = -1, shader: QgsRasterShader = None)

Bases: qgis._core.QgsRasterRenderer

Note: takes ownership of QgsRasterShader

Raster renderer pipe for single band pseudocolor.

Enums

Methods

accept

band

Returns the band used by the renderer

block

classificationMax

classificationMin

clone

QgsSingleBandPseudoColorRenderer cannot be copied.

constShader

create

createShader

Creates a color ramp shader

initHistogram

initStatistics

legendSymbologyItems

setBand

Sets the band used by the renderer.

setClassificationMax

setClassificationMin

setShader

Takes ownership of the shader

shader

Returns the raster shader

toSld

usesBands

writeXml

Signals

Attributes

accept(self, visitor: QgsStyleEntityVisitorInterface) → bool
band(self) → int

Returns the band used by the renderer

New in version 2.7.

block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback = None) → QgsRasterBlock
classificationMax(self) → float
classificationMin(self) → float
clone(self) → QgsSingleBandPseudoColorRenderer

QgsSingleBandPseudoColorRenderer cannot be copied. Use clone() instead.

constShader(self) → QgsRasterShader

Note

available in Python as constShader

create(elem: QDomElement, input: QgsRasterInterface) → QgsRasterRenderer
createShader(self, colorRamp: QgsColorRamp = None, colorRampType: QgsColorRampShader.Type = QgsColorRampShader.Interpolated, classificationMode: QgsColorRampShader.ClassificationMode = QgsColorRampShader.Continuous, classes: int = 0, clip: bool = False, extent: QgsRectangle = QgsRectangle())

Creates a color ramp shader

Parameters
  • colorRamp – vector color ramp. Ownership is transferred to the shader.

  • colorRampType – type of color ramp shader

  • classificationMode – classification mode

  • classes – number of classes

  • clip – clip out of range values

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

initHistogram()
initStatistics()
legendSymbologyItems(self) → List[Tuple[str, QColor]]
setBand(self, bandNo: int)

Sets the band used by the renderer.

See also

band()

New in version 2.10.

setClassificationMax(self, max: float)
setClassificationMin(self, min: float)
setShader(self, shader: QgsRasterShader)

Takes ownership of the shader

shader(self) → QgsRasterShader

Returns the raster shader

toSld(self, doc: QDomDocument, element: QDomElement, props: Dict[str, str] = {})
usesBands(self) → List[int]
writeXml(self, doc: QDomDocument, parentElem: QDomElement)