Class: QgsHueSaturationFilter¶
- class qgis.core.QgsHueSaturationFilter¶
Bases:
QgsRasterInterface
Color and saturation filter pipe for rasters.
Methods
- rtype
int
- param bandNo
- rtype
QgsHueSaturationFilter
- rtype
QColor
- rtype
bool
- rtype
int
- param bandNo
- rtype
QgsHueSaturationFilter.GrayscaleMode
Fill in histogram defaults if not specified
Fill in statistics defaults if not specified
Returns
True
if the filter inverts colors.Sets base class members from xml.
- rtype
int
- param colorizeColor
- param colorizeOn
- param colorizeStrength
- param grayscaleMode
- param input
Sets whether the filter will invert colors.
- param saturation
- param doc
Attributes
- GrayscaleAverage = 3¶
- GrayscaleLightness = 1¶
- GrayscaleLuminosity = 2¶
- class GrayscaleMode¶
Bases:
int
- GrayscaleOff = 0¶
- bandCount(self) int ¶
- Return type
int
- block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback = None) QgsRasterBlock ¶
- Parameters
bandNo (int) –
extent (QgsRectangle) –
width (int) –
height (int) –
feedback (
QgsRasterBlockFeedback
= None) –
- Return type
- clone(self) QgsHueSaturationFilter ¶
- Return type
- colorizeColor(self) QColor ¶
- Return type
QColor
- colorizeOn(self) bool ¶
- Return type
bool
- colorizeStrength(self) int ¶
- Return type
int
- dataType(self, bandNo: int) Qgis.DataType ¶
- Parameters
bandNo (int) –
- Return type
- grayscaleMode(self) QgsHueSaturationFilter.GrayscaleMode ¶
- Return type
- initHistogram(self, histogram: QgsRasterHistogram, bandNo: int, binCount: int, minimum: object = Py_None, maximum: object = Py_None, boundingBox: QgsRectangle = QgsRectangle(), sampleSize: int = 0, includeOutOfRange: bool = False)¶
Fill in histogram defaults if not specified
Note
the parameters are the same as in
histogram()
- initStatistics(self, statistics: QgsRasterBandStats, bandNo: int, stats: int = QgsRasterBandStats.All, boundingBox: QgsRectangle = QgsRectangle(), binCount: int = 0)¶
Fill in statistics defaults if not specified
- invertColors(self) bool ¶
Returns
True
if the filter inverts colors.New in version 3.22.
- Return type
bool
- readXml(self, filterElem: QDomElement)¶
Sets base class members from xml. Usually called from
create()
methods of subclasses- Parameters
filterElem (QDomElement) –
- saturation(self) int ¶
- Return type
int
- setColorizeColor(self, colorizeColor: Union[QColor, Qt.GlobalColor, QGradient])¶
- Parameters
colorizeColor (Union[QColor) –
- setColorizeOn(self, colorizeOn: bool)¶
- Parameters
colorizeOn (bool) –
- setColorizeStrength(self, colorizeStrength: int)¶
- Parameters
colorizeStrength (int) –
- setGrayscaleMode(self, grayscaleMode: QgsHueSaturationFilter.GrayscaleMode)¶
- Parameters
grayscaleMode (QgsHueSaturationFilter.GrayscaleMode) –
- setInput(self, input: QgsRasterInterface) bool ¶
- Parameters
input (QgsRasterInterface) –
- Return type
bool
- setInvertColors(self, invertColors: bool)¶
Sets whether the filter will invert colors.
- Parameters
invertColors (bool) – Set to
True
to invert colors.
New in version 3.22.
- setSaturation(self, saturation: int)¶
- Parameters
saturation (int) –
- writeXml(self, doc: QDomDocument, parentElem: QDomElement)¶
- Parameters
doc (QDomDocument) –
parentElem (QDomElement) –