QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsrastertransparency.h
Go to the documentation of this file.
1 /* **************************************************************************
2  qgsrastertransparency.h - description
3  -------------------
4 begin : Mon Nov 30 2007
5 copyright : (C) 2007 by Peter J. Ersts
6 email : [email protected]
7 
8 ****************************************************************************/
9 
10 /* **************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 #ifndef QGSRASTERTRANSPARENCY_H
19 #define QGSRASTERTRANSPARENCY_H
20 
21 #include <QList>
22 class QDomDocument;
23 class QDomElement;
24 
29 class CORE_EXPORT QgsRasterTransparency
30 {
31 
32  public:
34 
35  //
36  // Structs to hold transparent pixel vlaues
37  //
39  {
40  double red;
41  double green;
42  double blue;
44  };
45 
47  {
48  double min;
49  double max;
51  };
52 
53  //
54  // Initializer, Accessor and mutator for transparency tables.
55  //
57  QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
58 
60  QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
61 
63  void initializeTransparentPixelList( double );
64 
66  void initializeTransparentPixelList( double, double, double );
67 
69  void setTransparentSingleValuePixelList( QList<QgsRasterTransparency::TransparentSingleValuePixel> );
70 
72  void setTransparentThreeValuePixelList( QList<QgsRasterTransparency::TransparentThreeValuePixel> );
73 
75  int alphaValue( double, int theGlobalTransparency = 255 ) const;
76 
78  int alphaValue( double, double, double, int theGlobalTransparency = 255 ) const;
79 
81  bool isEmpty() const;
82 
83  void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
84 
85  void readXML( const QDomElement& elem );
86 
87  private:
89  QList<QgsRasterTransparency::TransparentThreeValuePixel> mTransparentThreeValuePixelList;
90 
92  QList<QgsRasterTransparency::TransparentSingleValuePixel> mTransparentSingleValuePixelList;
93 
94 };
95 #endif