def __get_color_ramp_items(renderer: QgsRasterRenderer, provider: QgsRasterDataProvider, color: QtGui.QColor) -> List[ QgsColorRampShader.ColorRampItem]: bands = renderer.usesBands() band_statistics = provider.bandStatistics(bands[0], QgsRasterBandStats.All) minValue = band_statistics.minimumValue maxValue = band_statistics.maximumValue min_color = QtGui.QColor(color) min_color.setAlpha(0) max_color = QtGui.QColor(color) max_color.setAlpha(255) return [ QgsColorRampShader.ColorRampItem(minValue, min_color), QgsColorRampShader.ColorRampItem(maxValue, max_color), ]
def __init__(self, interface): QgsRasterRenderer.__init__(self, interface, '')
def __init__(self, interface): QgsRasterRenderer.__init__(self, interface, '')