Class: QgsMultiBandColorRenderer

Renderer for multiband images with the color components.

Class Hierarchy

Inheritance diagram of qgis.core.QgsMultiBandColorRenderer

Base classes

QgsRasterRenderer

Raster renderer pipe that applies colors to a raster.

QgsRasterInterface

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

class qgis.core.QgsMultiBandColorRenderer[source]

Bases: QgsRasterRenderer

__init__(input: QgsRasterInterface | None, redBand: int, greenBand: int, blueBand: int, redEnhancement: QgsContrastEnhancement | None = None, greenEnhancement: QgsContrastEnhancement | None = None, blueEnhancement: QgsContrastEnhancement | None = None)

Constructor for QgsMultiBandColorRenderer.

Parameters:
  • input (Optional[QgsRasterInterface]) – input raster interface

  • redBand (int) – band number for red channel

  • greenBand (int) – band number for green channel

  • blueBand (int) – band number for blue channel

  • redEnhancement (Optional[QgsContrastEnhancement] = None) – optional contrast enhancement for red channel. Ownership is transferred to the renderer.

  • greenEnhancement (Optional[QgsContrastEnhancement] = None) – optional contrast enhancement for green channel. Ownership is transferred to the renderer.

  • blueEnhancement (Optional[QgsContrastEnhancement] = None) – optional contrast enhancement for blue channel. Ownership is transferred to the renderer.

blueBand(self) int[source]

Returns the band number for the blue channel.

See also

setRedBand()

Return type:

int

blueContrastEnhancement(self) QgsContrastEnhancement | None[source]

Returns the contrast enhancement to use for the blue channel.

Return type:

Optional[QgsContrastEnhancement]

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

Optional[QgsRasterRenderer]

greenBand(self) int[source]

Returns the band number for the green channel.

See also

setRedBand()

Return type:

int

greenContrastEnhancement(self) QgsContrastEnhancement | None[source]

Returns the contrast enhancement to use for the green channel.

Return type:

Optional[QgsContrastEnhancement]

redBand(self) int[source]

Returns the band number for the red channel.

See also

setRedBand()

Return type:

int

redContrastEnhancement(self) QgsContrastEnhancement | None[source]

Returns the contrast enhancement to use for the red channel.

Return type:

Optional[QgsContrastEnhancement]

setBlueBand(self, band: int)[source]

Sets the band number for the blue channel.

See also

blueBand()

Parameters:

band (int)

setBlueContrastEnhancement(self, ce: QgsContrastEnhancement | None)[source]

Sets the contrast enhancement to use for the blue channel.

Ownership of the enhancement is transferred.

Parameters:

ce (Optional[QgsContrastEnhancement])

setGreenBand(self, band: int)[source]

Sets the band number for the green channel.

See also

greenBand()

Parameters:

band (int)

setGreenContrastEnhancement(self, ce: QgsContrastEnhancement | None)[source]

Sets the contrast enhancement to use for the green channel.

Ownership of the enhancement is transferred.

Parameters:

ce (Optional[QgsContrastEnhancement])

setRedBand(self, band: int)[source]

Sets the band number for the red channel.

See also

redBand()

Parameters:

band (int)

setRedContrastEnhancement(self, ce: QgsContrastEnhancement | None)[source]

Sets the contrast enhancement to use for the red channel.

Ownership of the enhancement is transferred.

Parameters:

ce (Optional[QgsContrastEnhancement])