Class: QgsContrastEnhancementFunction

A contrast enhancement function is the base class for all raster contrast enhancements.

The purpose of a contrast enhancement is to enhanceContrast or clip a pixel value into a specified bounding range.

Class Hierarchy

Inheritance diagram of qgis.core.QgsContrastEnhancementFunction

Subclasses

QgsClipToMinMaxEnhancement

A raster contrast enhancement that will clip a value to the specified min/max range.

QgsLinearMinMaxEnhancement

A color enhancement function that performs a linear enhanceContrast between min and max.

QgsLinearMinMaxEnhancementWithClip

A linear enhanceContrast enhancement that first clips to min max and then enhanceContrastes linearly between min and max.

Methods

maximumValue

Returns the maximum value.

minimumValue

Returns the minimum value.

setMaximumValue

Sets the maximum value.

setMinimumValue

Sets the minimum value.

Virtual Methods

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

enhance

A customizable method that takes in a double value and returns a int between 0 and 255.

isValueInDisplayableRange

A customizable method to indicate if a pixel's value is within the displayable range.

class qgis.core.QgsContrastEnhancementFunction[source]

Bases: object

virtual enhance(self, value: float) int[source]

A customizable method that takes in a double value and returns a int between 0 and 255.

Parameters:

value (float)

Return type:

int

virtual isValueInDisplayableRange(self, value: float) bool[source]

A customizable method to indicate if a pixel’s value is within the displayable range.

Parameters:

value (float)

Return type:

bool

maximumValue(self) float[source]

Returns the maximum value.

See also

minimumValue()

Added in version 3.2.

Return type:

float

minimumValue(self) float[source]

Returns the minimum value.

See also

maximumValue()

Added in version 3.2.

Return type:

float

setMaximumValue(self, value: float)[source]

Sets the maximum value.

See also

maximumValue()

Parameters:

value (float)

setMinimumValue(self, value: float)[source]

Sets the minimum value.

See also

minimumValue()

Parameters:

value (float)