QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Classes | Public Member Functions | List of all members
QgsRasterTransparency Class Reference

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 ()
 
int alphaValue (double, int theGlobalTransparency=255) const
 Returns the transparency value for a single value Pixel. More...
 
int alphaValue (double, double, double, int theGlobalTransparency=255) const
 Return the transparency value for a RGB Pixel. More...
 
void initializeTransparentPixelList (double)
 Reset to the transparency list to a single value. More...
 
void initializeTransparentPixelList (double, double, double)
 Reset to 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)
 
void setTransparentSingleValuePixelList (const QList< TransparentSingleValuePixel > &theNewList)
 Mutator for transparentSingleValuePixelList. More...
 
void setTransparentThreeValuePixelList (const QList< TransparentThreeValuePixel > &theNewList)
 Mutator for transparentThreeValuePixelList. More...
 
QList< QgsRasterTransparency::TransparentSingleValuePixeltransparentSingleValuePixelList () const
 Accessor for transparentSingleValuePixelList. More...
 
QList< QgsRasterTransparency::TransparentThreeValuePixeltransparentThreeValuePixelList () const
 Accessor for transparentThreeValuePixelList. More...
 
void writeXML (QDomDocument &doc, QDomElement &parentElem) const
 

Detailed Description

Defines the list of pixel values to be considered as transparent or semi transparent when rendering rasters.

Definition at line 29 of file qgsrastertransparency.h.

Constructor & Destructor Documentation

◆ QgsRasterTransparency()

QgsRasterTransparency::QgsRasterTransparency ( )

Definition at line 27 of file qgsrastertransparency.cpp.

Member Function Documentation

◆ alphaValue() [1/2]

int QgsRasterTransparency::alphaValue ( double  theValue,
int  theGlobalTransparency = 255 
) const

Returns the transparency value for a single value Pixel.

Searches through the transparency list, if a match is found, the global transparency value is scaled by the stored transparency value.

Parameters
theValuethe needle to search for in the transparency hay stack
theGlobalTransparencythe overal transparency level for the layer

Definition at line 104 of file qgsrastertransparency.cpp.

◆ alphaValue() [2/2]

int QgsRasterTransparency::alphaValue ( double  theRedValue,
double  theGreenValue,
double  theBlueValue,
int  theGlobalTransparency = 255 
) const

Return 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.

Parameters
theRedValuethe red portion of the needle to search for in the transparency hay stack
theGreenValuethe green portion of the needle to search for in the transparency hay stack
theBlueValuethe green portion of the needle to search for in the transparency hay stack
theGlobalTransparencythe overal transparency level for the layer

Definition at line 144 of file qgsrastertransparency.cpp.

◆ initializeTransparentPixelList() [1/2]

void QgsRasterTransparency::initializeTransparentPixelList ( double  theValue)

Reset to the transparency list to a single value.

Definition at line 51 of file qgsrastertransparency.cpp.

◆ initializeTransparentPixelList() [2/2]

void QgsRasterTransparency::initializeTransparentPixelList ( double  theRedValue,
double  theGreenValue,
double  theBlueValue 
)

Reset to the transparency list to a single value.

Definition at line 67 of file qgsrastertransparency.cpp.

◆ isEmpty()

bool QgsRasterTransparency::isEmpty ( ) const

True if there are no entries in the pixel lists except the nodata value.

Definition at line 180 of file qgsrastertransparency.cpp.

◆ readXML()

void QgsRasterTransparency::readXML ( const QDomElement elem)

Definition at line 221 of file qgsrastertransparency.cpp.

◆ setTransparentSingleValuePixelList()

void QgsRasterTransparency::setTransparentSingleValuePixelList ( const QList< TransparentSingleValuePixel > &  theNewList)

Mutator for transparentSingleValuePixelList.

Mutator for transparentSingleValuePixelList, replaces the whole list.

Definition at line 85 of file qgsrastertransparency.cpp.

◆ setTransparentThreeValuePixelList()

void QgsRasterTransparency::setTransparentThreeValuePixelList ( const QList< TransparentThreeValuePixel > &  theNewList)

Mutator for transparentThreeValuePixelList.

Mutator for transparentThreeValuePixelList, replaces the whole list.

Definition at line 93 of file qgsrastertransparency.cpp.

◆ transparentSingleValuePixelList()

QList< QgsRasterTransparency::TransparentSingleValuePixel > QgsRasterTransparency::transparentSingleValuePixelList ( ) const

Accessor for transparentSingleValuePixelList.

Definition at line 35 of file qgsrastertransparency.cpp.

◆ transparentThreeValuePixelList()

QList< QgsRasterTransparency::TransparentThreeValuePixel > QgsRasterTransparency::transparentThreeValuePixelList ( ) const

Accessor for transparentThreeValuePixelList.

Definition at line 43 of file qgsrastertransparency.cpp.

◆ writeXML()

void QgsRasterTransparency::writeXML ( QDomDocument doc,
QDomElement parentElem 
) const

Definition at line 185 of file qgsrastertransparency.cpp.


The documentation for this class was generated from the following files: