Quantum GIS API Documentation  1.8
Classes | Public Member Functions | Private Attributes
QgsRasterTransparency Class Reference

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

#include <qgsrastertransparency.h>

List of all members.

Classes

struct  TransparentSingleValuePixel
struct  TransparentThreeValuePixel

Public Member Functions

 QgsRasterTransparency ()
QList
< QgsRasterTransparency::TransparentSingleValuePixel
transparentSingleValuePixelList () const
 Mutator for transparentSingleValuePixelList.
QList
< QgsRasterTransparency::TransparentThreeValuePixel
transparentThreeValuePixelList () const
 Mutator 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 >)
 Accessor for transparentSingleValuePixelList.
void setTransparentThreeValuePixelList (QList< QgsRasterTransparency::TransparentThreeValuePixel >)
 Accessor 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.

Private Attributes

QList
< QgsRasterTransparency::TransparentThreeValuePixel
mTransparentThreeValuePixelList
 The list to hold transparency values for RGB layers.
QList
< QgsRasterTransparency::TransparentSingleValuePixel
mTransparentSingleValuePixelList
 The lsit to hold transparency values for single value pixel layers.

Detailed Description

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

Definition at line 25 of file qgsrastertransparency.h.


Constructor & Destructor Documentation

Definition at line 22 of file qgsrastertransparency.cpp.


Member Function Documentation

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 98 of file qgsrastertransparency.cpp.

References mTransparentSingleValuePixelList, QgsRasterTransparency::TransparentSingleValuePixel::percentTransparent, and QgsRasterTransparency::TransparentSingleValuePixel::pixelValue.

Referenced by QgsRasterLayer::drawMultiBandColor(), QgsRasterLayer::drawPalettedSingleBandColor(), QgsRasterLayer::drawPalettedSingleBandGray(), QgsRasterLayer::drawPalettedSingleBandPseudoColor(), QgsRasterLayer::drawSingleBandGray(), and QgsRasterLayer::drawSingleBandPseudoColor().

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 136 of file qgsrastertransparency.cpp.

References QgsRasterTransparency::TransparentThreeValuePixel::blue, QgsRasterTransparency::TransparentThreeValuePixel::green, mTransparentThreeValuePixelList, QgsRasterTransparency::TransparentThreeValuePixel::percentTransparent, and QgsRasterTransparency::TransparentThreeValuePixel::red.

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

Accessor for transparentSingleValuePixelList.

Mutator for transparentSingleValuePixelList, replaces the whole list.

Definition at line 79 of file qgsrastertransparency.cpp.

References mTransparentSingleValuePixelList.

Referenced by QgsRasterLayer::readSymbology().

Accessor for transparentThreeValuePixelList.

Mutator for transparentThreeValuePixelList, replaces the whole list.

Definition at line 87 of file qgsrastertransparency.cpp.

References mTransparentThreeValuePixelList.

Referenced by QgsRasterLayer::readSymbology().

Mutator for transparentSingleValuePixelList.

Accessor for transparentSingleValuePixelList.

Definition at line 30 of file qgsrastertransparency.cpp.

References mTransparentSingleValuePixelList.

Referenced by QgsRasterLayer::writeSymbology().

Mutator for transparentThreeValuePixelList.

Accessor for transparentThreeValuePixelList.

Definition at line 38 of file qgsrastertransparency.cpp.

References mTransparentThreeValuePixelList.

Referenced by QgsRasterLayer::writeSymbology().


Member Data Documentation

The lsit to hold transparency values for single value pixel layers.

Definition at line 80 of file qgsrastertransparency.h.

Referenced by alphaValue(), initializeTransparentPixelList(), setTransparentSingleValuePixelList(), and transparentSingleValuePixelList().

The list to hold transparency values for RGB layers.

Definition at line 77 of file qgsrastertransparency.h.

Referenced by alphaValue(), initializeTransparentPixelList(), setTransparentThreeValuePixelList(), and transparentThreeValuePixelList().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines