Class: QgsSingleBandColorDataRenderer

class qgis.core.QgsSingleBandColorDataRenderer

Bases: QgsRasterRenderer

Raster renderer pipe for single band color.

Methods

block

param bandNo:

clone

QgsSingleBandColorDataRenderer cannot be copied.

create

param elem:

flags

rtype:

Qgis.RasterRendererFlags

initHistogram

Fill in histogram defaults if not specified

initStatistics

Fill in statistics defaults if not specified

renderColorForNodataPixel

Returns the color for the renderer to use to represent nodata pixels.

setInput

param input:

usesBands

rtype:

List[int]

writeXml

param doc:

block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback | None = None) QgsRasterBlock | None
Parameters:
Return type:

Optional[QgsRasterBlock]

clone(self) QgsSingleBandColorDataRenderer | None

QgsSingleBandColorDataRenderer cannot be copied. Use clone() instead.

Return type:

Optional[QgsSingleBandColorDataRenderer]

create(elem: QDomElement, input: QgsRasterInterface | None) QgsRasterRenderer | None
Parameters:
Return type:

Optional[QgsRasterRenderer]

flags(self) Qgis.RasterRendererFlags
Return type:

Qgis.RasterRendererFlags

initHistogram(self, histogram: QgsRasterHistogram, bandNo: int, binCount: int, minimum: Any = Py_None, maximum: Any = Py_None, boundingBox: QgsRectangle = QgsRectangle(), sampleSize: int = 0, includeOutOfRange: bool = False)

Fill in histogram defaults if not specified

Note

the parameters are the same as in histogram()

initStatistics(self, statistics: QgsRasterBandStats, bandNo: int, stats: int, boundingBox: QgsRectangle = QgsRectangle(), binCount: int = 0)

Fill in statistics defaults if not specified

Deprecated since version Use: Qgis.RasterBandStatistic instead of int for stats argument

initStatistics(self, statistics: QgsRasterBandStats, bandNo: int, stats: Union[Qgis.RasterBandStatistics, Qgis.RasterBandStatistic] = Qgis.RasterBandStatistic.All, boundingBox: QgsRectangle = QgsRectangle(), binCount: int = 0) Fill in statistics defaults if not specified

renderColorForNodataPixel(self) int

Returns the color for the renderer to use to represent nodata pixels.

Subclasses should use this rather then nodataColor() to determine the color to use for nodata pixels during an actual rendering operation.

Added in version 3.10.

setInput(self, input: QgsRasterInterface | None) bool
Parameters:

input (Optional[QgsRasterInterface])

Return type:

bool

usesBands(self) List[int]
Return type:

List[int]

writeXml(self, doc: QDomDocument, parentElem: QDomElement)
Parameters:
  • doc (QDomDocument)

  • parentElem (QDomElement)