Class: QgsRasterResampler

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

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: clone(), resample(), type()

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.

Abstract Methods

clone

Gets a deep copy of this object.

resample

Resamples a source image to a destination image.

type

Gets a descriptive type identifier for this raster resampler.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsRasterResampler. See the FAQ for more details.

tileBufferPixels

Returns the optional tile buffer size in pixels.

class qgis.core.QgsRasterResampler[source]

Bases: object

abstract 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]

abstract 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)

virtual 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

abstract type(self) str[source]

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

Return type:

str