Class: QgsRasterRendererUtils

class qgis.core.QgsRasterRendererUtils

Bases: sip.wrapper

Utility functions for raster renderers.

Added in version 3.16:

Methods

parseColorMapFile

Parses an exported color map file at the specified path and extracts the stored color ramp items and ramp shader type.

saveColorMapFile

Exports a list of color ramp items and ramp shader type to a color map file at the specified path.

parseColorMapFile(path: str | None)

Parses an exported color map file at the specified path and extracts the stored color ramp items and ramp shader type.

Returns True if the parsing was successful. If not, a list of errors will be generated.

Parameters:

path (Optional[str]) -> (bool)

saveColorMapFile(path: str | None, items: Iterable[QgsColorRampShader.ColorRampItem], type: Qgis.ShaderInterpolationMethod) bool

Exports a list of color ramp items and ramp shader type to a color map file at the specified path.

Returns True if the save was successful.

Parameters:
Return type:

bool