QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Defines the list of pixel values to be considered as transparent or semi transparent when rendering rasters. More...
#include <qgsrastertransparency.h>
Classes | |
struct | TransparentSingleValuePixel |
struct | TransparentThreeValuePixel |
Public Member Functions | |
QgsRasterTransparency ()=default | |
Constructor for QgsRasterTransparency. More... | |
int | alphaValue (double redValue, double greenValue, double blueValue, int globalTransparency=255) const |
Returns the transparency value for a RGB pixel. More... | |
int | alphaValue (double value, int globalTransparency=255) const |
Returns the transparency value for a single value pixel. More... | |
void | initializeTransparentPixelList (double redValue, double greenValue, double blueValue) |
Resets the transparency list to single red, green, and blue values. More... | |
void | initializeTransparentPixelList (double value) |
Resets the transparency list to a single value. More... | |
bool | isEmpty () const |
True if there are no entries in the pixel lists except the nodata value. More... | |
void | readXml (const QDomElement &elem) |
Reads the transparency information from an XML document. More... | |
void | setTransparentSingleValuePixelList (const QList< QgsRasterTransparency::TransparentSingleValuePixel > &newList) |
Sets the transparent single value pixel list, replacing the whole existing list. More... | |
void | setTransparentThreeValuePixelList (const QList< QgsRasterTransparency::TransparentThreeValuePixel > &newList) |
Sets the transparent three value pixel list, replacing the whole existing list. More... | |
QList< QgsRasterTransparency::TransparentSingleValuePixel > | transparentSingleValuePixelList () const |
Returns the transparent single value pixel list. More... | |
QList< QgsRasterTransparency::TransparentThreeValuePixel > | transparentThreeValuePixelList () const |
Returns the transparent three value pixel list. More... | |
void | writeXml (QDomDocument &doc, QDomElement &parentElem) const |
Writes the transparency information to an XML document. More... | |
Defines the list of pixel values to be considered as transparent or semi transparent when rendering rasters.
Definition at line 32 of file qgsrastertransparency.h.
|
default |
Constructor for QgsRasterTransparency.
int QgsRasterTransparency::alphaValue | ( | double | redValue, |
double | greenValue, | ||
double | blueValue, | ||
int | globalTransparency = 255 |
||
) | const |
Returns the transparency value for a RGB pixel.
Searches through the transparency list, if a match is found, the global transparency value is scaled by the stored transparency value.
redValue | the red portion of the needle to search for in the transparency hay stack |
greenValue | the green portion of the needle to search for in the transparency hay stack |
blueValue | the green portion of the needle to search for in the transparency hay stack |
globalTransparency | the overall transparency level for the layer |
Definition at line 106 of file qgsrastertransparency.cpp.
int QgsRasterTransparency::alphaValue | ( | double | value, |
int | globalTransparency = 255 |
||
) | const |
Returns the transparency value for a single value pixel.
Searches through the transparency list, and if a match is found, the global transparency value is scaled by the stored transparency value.
value | the needle to search for in the transparency hay stack |
globalTransparency | the overall transparency level for the layer |
Definition at line 74 of file qgsrastertransparency.cpp.
void QgsRasterTransparency::initializeTransparentPixelList | ( | double | redValue, |
double | greenValue, | ||
double | blueValue | ||
) |
Resets the transparency list to single red, green, and blue values.
Definition at line 50 of file qgsrastertransparency.cpp.
void QgsRasterTransparency::initializeTransparentPixelList | ( | double | value | ) |
Resets the transparency list to a single value.
Definition at line 37 of file qgsrastertransparency.cpp.
bool QgsRasterTransparency::isEmpty | ( | ) | const |
True if there are no entries in the pixel lists except the nodata value.
Definition at line 142 of file qgsrastertransparency.cpp.
void QgsRasterTransparency::readXml | ( | const QDomElement & | elem | ) |
Reads the transparency information from an XML document.
Definition at line 183 of file qgsrastertransparency.cpp.
void QgsRasterTransparency::setTransparentSingleValuePixelList | ( | const QList< QgsRasterTransparency::TransparentSingleValuePixel > & | newList | ) |
Sets the transparent single value pixel list, replacing the whole existing list.
Definition at line 64 of file qgsrastertransparency.cpp.
void QgsRasterTransparency::setTransparentThreeValuePixelList | ( | const QList< QgsRasterTransparency::TransparentThreeValuePixel > & | newList | ) |
Sets the transparent three value pixel list, replacing the whole existing list.
Definition at line 69 of file qgsrastertransparency.cpp.
QList< QgsRasterTransparency::TransparentSingleValuePixel > QgsRasterTransparency::transparentSingleValuePixelList | ( | ) | const |
Returns the transparent single value pixel list.
Definition at line 27 of file qgsrastertransparency.cpp.
QList< QgsRasterTransparency::TransparentThreeValuePixel > QgsRasterTransparency::transparentThreeValuePixelList | ( | ) | const |
Returns the transparent three value pixel list.
Definition at line 32 of file qgsrastertransparency.cpp.
void QgsRasterTransparency::writeXml | ( | QDomDocument & | doc, |
QDomElement & | parentElem | ||
) | const |
Writes the transparency information to an XML document.
Definition at line 147 of file qgsrastertransparency.cpp.