QGIS API Documentation
2.0.1-Dufour
|
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 () | |
QList < QgsRasterTransparency::TransparentSingleValuePixel > | transparentSingleValuePixelList () const |
Accessor for transparentSingleValuePixelList. | |
QList < QgsRasterTransparency::TransparentThreeValuePixel > | transparentThreeValuePixelList () const |
Accessor for transparentThreeValuePixelList. | |
void | initializeTransparentPixelList (double) |
Reset to the transparency list to a single value. | |
void | initializeTransparentPixelList (double, double, double) |
Reset to the transparency list to a single value. | |
void | setTransparentSingleValuePixelList (QList< QgsRasterTransparency::TransparentSingleValuePixel >) |
Mutator for transparentSingleValuePixelList. | |
void | setTransparentThreeValuePixelList (QList< QgsRasterTransparency::TransparentThreeValuePixel >) |
Mutator for transparentThreeValuePixelList. | |
int | alphaValue (double, int theGlobalTransparency=255) const |
Returns the transparency value for a single value Pixel. | |
int | alphaValue (double, double, double, int theGlobalTransparency=255) const |
Return the transparency value for a RGB Pixel. | |
bool | isEmpty () const |
True if there are no entries in the pixel lists except the nodata value. | |
void | writeXML (QDomDocument &doc, QDomElement &parentElem) const |
void | readXML (const QDomElement &elem) |
Private Attributes | |
QList < QgsRasterTransparency::TransparentThreeValuePixel > | mTransparentThreeValuePixelList |
The list to hold transparency values for RGB layers. | |
QList < QgsRasterTransparency::TransparentSingleValuePixel > | mTransparentSingleValuePixelList |
The list to hold transparency values for single value pixel layers. |
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.
QgsRasterTransparency::QgsRasterTransparency | ( | ) |
Definition at line 27 of file qgsrastertransparency.cpp.
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.
theValue | the needle to search for in the transparency hay stack |
theGlobalTransparency | the overal transparency level for the layer |
Definition at line 104 of file qgsrastertransparency.cpp.
References QgsRasterTransparency::TransparentSingleValuePixel::max, QgsRasterTransparency::TransparentSingleValuePixel::min, mTransparentSingleValuePixelList, QgsRasterTransparency::TransparentSingleValuePixel::percentTransparent, and qgsDoubleNear().
Referenced by QgsPalettedRasterRenderer::block(), QgsSingleBandPseudoColorRenderer::block(), QgsMultiBandColorRenderer::block(), and QgsSingleBandGrayRenderer::block().
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.
theRedValue | the red portion of the needle to search for in the transparency hay stack |
theGreenValue | the green portion of the needle to search for in the transparency hay stack |
theBlueValue | the green portion of the needle to search for in the transparency hay stack |
theGlobalTransparency | the overal transparency level for the layer |
Definition at line 144 of file qgsrastertransparency.cpp.
References QgsRasterTransparency::TransparentThreeValuePixel::blue, QgsRasterTransparency::TransparentThreeValuePixel::green, mTransparentThreeValuePixelList, QgsRasterTransparency::TransparentThreeValuePixel::percentTransparent, and QgsRasterTransparency::TransparentThreeValuePixel::red.
void QgsRasterTransparency::initializeTransparentPixelList | ( | double | theValue | ) |
Reset to the transparency list to a single value.
Definition at line 51 of file qgsrastertransparency.cpp.
References QgsRasterTransparency::TransparentSingleValuePixel::max, QgsRasterTransparency::TransparentSingleValuePixel::min, mTransparentSingleValuePixelList, and QgsRasterTransparency::TransparentSingleValuePixel::percentTransparent.
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.
References QgsRasterTransparency::TransparentThreeValuePixel::blue, QgsRasterTransparency::TransparentThreeValuePixel::green, mTransparentThreeValuePixelList, QgsRasterTransparency::TransparentThreeValuePixel::percentTransparent, and QgsRasterTransparency::TransparentThreeValuePixel::red.
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.
References mTransparentSingleValuePixelList, and mTransparentThreeValuePixelList.
Referenced by QgsRasterRenderer::usesTransparency().
void QgsRasterTransparency::readXML | ( | const QDomElement & | elem | ) |
Definition at line 221 of file qgsrastertransparency.cpp.
References QgsRasterTransparency::TransparentThreeValuePixel::blue, QgsRasterTransparency::TransparentThreeValuePixel::green, QgsRasterTransparency::TransparentSingleValuePixel::max, QgsRasterTransparency::TransparentSingleValuePixel::min, mTransparentSingleValuePixelList, mTransparentThreeValuePixelList, QgsRasterTransparency::TransparentThreeValuePixel::percentTransparent, QgsRasterTransparency::TransparentSingleValuePixel::percentTransparent, and QgsRasterTransparency::TransparentThreeValuePixel::red.
Referenced by QgsRasterRenderer::readXML().
void QgsRasterTransparency::setTransparentSingleValuePixelList | ( | QList< QgsRasterTransparency::TransparentSingleValuePixel > | theNewList | ) |
Mutator for transparentSingleValuePixelList.
Mutator for transparentSingleValuePixelList, replaces the whole list.
Definition at line 85 of file qgsrastertransparency.cpp.
References mTransparentSingleValuePixelList.
Referenced by QgsRasterRendererRegistry::defaultRendererForDrawingStyle().
void QgsRasterTransparency::setTransparentThreeValuePixelList | ( | QList< QgsRasterTransparency::TransparentThreeValuePixel > | theNewList | ) |
Mutator for transparentThreeValuePixelList.
Mutator for transparentThreeValuePixelList, replaces the whole list.
Definition at line 93 of file qgsrastertransparency.cpp.
References mTransparentThreeValuePixelList.
Referenced by QgsRasterRendererRegistry::defaultRendererForDrawingStyle().
QList< QgsRasterTransparency::TransparentSingleValuePixel > QgsRasterTransparency::transparentSingleValuePixelList | ( | ) | const |
Accessor for transparentSingleValuePixelList.
Definition at line 35 of file qgsrastertransparency.cpp.
References mTransparentSingleValuePixelList.
Referenced by QgsRasterLayerSaveAsDialog::on_mLoadTransparentNoDataToolButton_clicked().
QList< QgsRasterTransparency::TransparentThreeValuePixel > QgsRasterTransparency::transparentThreeValuePixelList | ( | ) | const |
Accessor for transparentThreeValuePixelList.
Definition at line 43 of file qgsrastertransparency.cpp.
References mTransparentThreeValuePixelList.
void QgsRasterTransparency::writeXML | ( | QDomDocument & | doc, |
QDomElement & | parentElem | ||
) | const |
Definition at line 185 of file qgsrastertransparency.cpp.
References mTransparentSingleValuePixelList, mTransparentThreeValuePixelList, and QgsRasterBlock::printValue().
Referenced by QgsRasterRenderer::_writeXML().
|
private |
The list to hold transparency values for single value pixel layers.
Definition at line 93 of file qgsrastertransparency.h.
Referenced by alphaValue(), initializeTransparentPixelList(), isEmpty(), readXML(), setTransparentSingleValuePixelList(), transparentSingleValuePixelList(), and writeXML().
|
private |
The list to hold transparency values for RGB layers.
Definition at line 90 of file qgsrastertransparency.h.
Referenced by alphaValue(), initializeTransparentPixelList(), isEmpty(), readXML(), setTransparentThreeValuePixelList(), transparentThreeValuePixelList(), and writeXML().