Class: QgsRasterResampler

Interface for resampling rasters (e.g. to have a smoother appearance)

Class Hierarchy

Inheritance diagram of qgis.core.QgsRasterResampler

Subclasses

QgsRasterResamplerV2

Interface for resampling rasters (V2) (e.g. to have a smoother appearance), which provides a more efficient interface vs QgsRasterResampler.

Methods

clone

Gets a deep copy of this object.

resample

Resamples a source image to a destination image.

tileBufferPixels

Returns the optional tile buffer size in pixels.

type

Gets a descriptive type identifier for this raster resampler.

class qgis.core.QgsRasterResampler[source]

Bases: object

clone(self) QgsRasterResampler | None[source]

Gets a deep copy of this object. Needs to be reimplemented by subclasses. Ownership is transferred to the caller.

Return type:

Optional[QgsRasterResampler]

resample(self, srcImage: QImage, dstImage: QImage)[source]

Resamples a source image to a destination image.

The size of the passed destination image should be respected during the resampling process.

Deprecated since version 3.10.1: Use the more efficient QgsRasterResamplerV2 interface instead.

Parameters:
  • srcImage (QImage)

  • dstImage (QImage)

tileBufferPixels(self) int[source]

Returns the optional tile buffer size in pixels. This represents the size to buffer individual resampled tile requests prior to resampling, in order to avoid rendering artifacts at the edges of raster tile boundaries.

Added in version 3.10.1.

Return type:

int

type(self) str[source]

Gets a descriptive type identifier for this raster resampler. Needs to be implemented by subclasses.

Return type:

str