QGIS API Documentation  2.99.0-Master (7d4f81d)
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 "qgis_core.h"
22 #include "qgis_sip.h"
23 #include <QList>
24 class QDomDocument;
25 class QDomElement;
26 
31 class CORE_EXPORT QgsRasterTransparency
32 {
33 
34  public:
36 
37  //
38  // Structs to hold transparent pixel vlaues
39  //
41  {
42  double red;
43  double green;
44  double blue;
46  };
47 
49  {
50  double min;
51  double max;
53  };
54 
55  //
56  // Initializer, Accessor and mutator for transparency tables.
57  //
59  QList<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
60 
62  QList<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
63 
65  void initializeTransparentPixelList( double );
66 
68  void initializeTransparentPixelList( double, double, double );
69 
71  void setTransparentSingleValuePixelList( const QList<QgsRasterTransparency::TransparentSingleValuePixel> &newList SIP_TRANSFER );
72 
74  void setTransparentThreeValuePixelList( const QList<QgsRasterTransparency::TransparentThreeValuePixel> &newList SIP_TRANSFER );
75 
77  int alphaValue( double, int globalTransparency = 255 ) const;
78 
80  int alphaValue( double, double, double, int globalTransparency = 255 ) const;
81 
83  bool isEmpty() const;
84 
85  void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
86 
87  void readXml( const QDomElement &elem );
88 
89  private:
91  QList<QgsRasterTransparency::TransparentThreeValuePixel> mTransparentThreeValuePixelList;
92 
94  QList<QgsRasterTransparency::TransparentSingleValuePixel> mTransparentSingleValuePixelList;
95 
96 };
97 #endif
#define SIP_TRANSFER
Definition: qgis_sip.h:36
Defines the list of pixel values to be considered as transparent or semi transparent when rendering r...