Class: QgsBrightnessContrastFilter¶
- class qgis.core.QgsBrightnessContrastFilter¶
Bases:
QgsRasterInterface
Brightness/contrast and gamma correction filter pipe for rasters.
Methods
Gets number of bands
Read block of data using given extent and size.
Returns current brightness level.
Clone itself, create deep copy
Returns current contrast level.
Returns data type for the band specified by number
Returns current gamma value.
Fill in histogram defaults if not specified
Fill in statistics defaults if not specified
Sets base class members from xml.
Set brightness level.
Set contrast level.
Set gamma value.
Set input.
Write base class members to xml.
- bandCount(self) int ¶
Gets number of bands
- Return type
int
- block(self, bandNo: int, extent: QgsRectangle, width: int, height: int, feedback: QgsRasterBlockFeedback = None) QgsRasterBlock ¶
Read block of data using given extent and size. Returns pointer to data. Caller is responsible to free the memory returned.
- Parameters
bandNo (int) – band number
extent (QgsRectangle) – extent of block
width (int) – pixel width of block
height (int) – pixel height of block
feedback (
QgsRasterBlockFeedback
= None) – optional raster feedback object for cancellation/preview. Added in QGIS 3.0.
- Return type
- brightness(self) int ¶
Returns current brightness level.
See also
- Return type
int
- clone(self) QgsBrightnessContrastFilter ¶
Clone itself, create deep copy
- Return type
- contrast(self) int ¶
Returns current contrast level.
See also
- Return type
int
- dataType(self, bandNo: int) Qgis.DataType ¶
Returns data type for the band specified by number
- Parameters
bandNo (int) –
- Return type
- gamma(self) float ¶
Returns current gamma value.
See also
New in version 3.16.
- Return type
float
- 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
- readXml(self, filterElem: QDomElement)¶
Sets base class members from xml. Usually called from
create()
methods of subclasses- Parameters
filterElem (QDomElement) –
- setBrightness(self, brightness: int)¶
Set brightness level. Acceptable value range is -255…255
See also
- Parameters
brightness (int) –
- setContrast(self, contrast: int)¶
Set contrast level. Acceptable value range is -100…100
See also
- Parameters
contrast (int) –
- setGamma(self, gamma: float)¶
Set gamma value. Acceptable value range is -0.1…10
See also
New in version 3.16.
- Parameters
gamma (float) –
- setInput(self, input: QgsRasterInterface) bool ¶
Set input. Returns
True
if set correctly,False
if cannot use that input- Parameters
input (QgsRasterInterface) –
- Return type
bool
- writeXml(self, doc: QDomDocument, parentElem: QDomElement)¶
Write base class members to xml.
- Parameters
doc (QDomDocument) –
parentElem (QDomElement) –