Class: QgsRasterDrawer

class qgis.core.QgsRasterDrawer

Bases: sip.wrapper

The drawing pipe for raster layers.

QgsRasterDrawer(iterator: QgsRasterIterator, dpiTarget: float) The QgsRasterDrawer constructor.

Parameters
  • iterator – the raster iterator to fetch data from

  • dpiTarget – the target dpi (dots per inch) to be taken into consideration when rendering

Deprecated since version QGIS: 3.28. Use the constructor without the dpiTarget argument instead, as DPI is now handled by the draw() method which accepts a QgsRenderContext.

QgsRasterDrawer(iterator: QgsRasterIterator) The QgsRasterDrawer constructor.

Parameters

iterator – the raster iterator to fetch data from

QgsRasterDrawer(QgsRasterDrawer)

Methods

draw

Draws raster data.

draw(self, p: QPainter, viewPort: QgsRasterViewPort, qgsMapToPixel: QgsMapToPixel, feedback: QgsRasterBlockFeedback = None)

Draws raster data.

Parameters
  • p (QPainter) – destination QPainter

  • viewPort (QgsRasterViewPort) – viewport to render

  • qgsMapToPixel (QgsMapToPixel) – map to pixel converter

  • feedback (QgsRasterBlockFeedback = None) – optional raster feedback object for cancellation/preview. Added in QGIS 3.0.

draw(self, context: QgsRenderContext, viewPort: QgsRasterViewPort, feedback: QgsRasterBlockFeedback = None) Draws raster data.

Parameters
  • context – the render context

  • viewPort – viewport to render

  • feedback – optional raster feedback object for cancellation/preview.

New in version 3.28.