Class: QgsRasterShaderFunction¶
The raster shade function applies a shader to a pixel at render time - typically used to render grayscale images as false color.
Class Hierarchy¶
Subclasses¶
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.  | 
Methods
Returns label precision  | 
|
Returns legend symbology items if provided by renderer.  | 
|
Returns the minimum value for the raster shader.  | 
|
Returns the maximum value for the raster shader.  | 
|
Sets label precision to labelPrecision  | 
|
Sets the maximum value for the raster shader.  | 
|
Sets the minimum value for the raster shader.  | 
|
Generates an new RGBA value based on one input value.  | 
- class qgis.core.QgsRasterShaderFunction[source]¶
 Bases:
object- legendSymbologyItems(self) List[Tuple[str, QColor]][source]¶
 Returns legend symbology items if provided by renderer.
- Return type:
 List[Tuple[str, QColor]]
- maximumValue(self) float[source]¶
 Returns the minimum value for the raster shader.
See also
See also
- Return type:
 float
- minimumValue(self) float[source]¶
 Returns the maximum value for the raster shader.
See also
See also
- Return type:
 float
- setLabelPrecision(self, labelPrecision: int)[source]¶
 Sets label precision to
labelPrecisionAdded in version 3.16.
- Parameters:
 labelPrecision (int)
- setMaximumValue(self, value: float)[source]¶
 Sets the maximum
valuefor the raster shader.See also
See also
- Parameters:
 value (float)
- setMinimumValue(self, value: float)[source]¶
 Sets the minimum
valuefor the raster shader.See also
See also
- Parameters:
 value (float)
- shade(self, value: float)[source]¶
 Generates an new RGBA value based on one input
value.- Parameters:
 value (float) -> (bool) – The original value to base a new RGBA value on
- Returns:
 Trueif the return values are valid otherwiseFalsereturnRedValue: The red component of the new RGBA value
returnGreenValue: The green component of the new RGBA value
returnBlueValue: The blue component of the new RGBA value
returnAlpha: The alpha component of the new RGBA value
- shade(self, redValue: float, greenValue: float, blueValue: float, alphaValue: float)[source]
 Generates an new RGBA value based on an original RGBA value.
- Parameters:
 redValue (float) – The red component of the original value to base a new RGBA value on
greenValue (float) – The green component of the original value to base a new RGBA value on
blueValue (float) – The blue component of the original value to base a new RGBA value on
alphaValue (float) -> (bool) – The alpha component of the original value to base a new RGBA value on
- Returns:
 Trueif the return values are valid otherwiseFalsereturnRedValue: The red component of the new RGBA value
returnGreenValue: The green component of the new RGBA value
returnBlueValue: The blue component of the new RGBA value
returnAlpha: The alpha component of the new RGBA value