QGIS API Documentation  2.99.0-Master (c42dad3)
qgsrastershader.h
Go to the documentation of this file.
1 /* **************************************************************************
2  qgsrastershader.h - description
3  -------------------
4 begin : Fri Dec 28 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 
19 
20 #ifndef QGSRASTERSHADER_H
21 #define QGSRASTERSHADER_H
22 
23 class QDomDocument;
24 class QDomElement;
26 
30 class CORE_EXPORT QgsRasterShader
31 {
32 
33  public:
34  QgsRasterShader( double theMinimumValue = 0.0, double theMaximumValue = 255.0 );
35  ~QgsRasterShader();
36 
37  /*
38  *
39  * Non-Static Inline methods
40  *
41  */
43  double maximumValue() { return mMaximumValue; }
44 
46  double minimumValue() { return mMinimumValue; }
47 
48  QgsRasterShaderFunction* rasterShaderFunction() { return mRasterShaderFunction; }
49  const QgsRasterShaderFunction* rasterShaderFunction() const { return mRasterShaderFunction; }
50 
51  /*
52  *
53  * Non-Static methods
54  *
55  */
57  bool shade( double, int*, int*, int*, int* );
58 
60  bool shade( double, double, double, double, int*, int*, int*, int* );
61 
64  void setRasterShaderFunction( QgsRasterShaderFunction* );
65 
67  void setMaximumValue( double );
68 
70  void setMinimumValue( double );
71 
72  void writeXml( QDomDocument& doc, QDomElement& parent ) const;
73 
74  void readXml( const QDomElement& elem );
75 
76  private:
78  double mMinimumValue;
79 
81  double mMaximumValue;
82 
84  QgsRasterShaderFunction* mRasterShaderFunction;
85 
86  QgsRasterShader( const QgsRasterShader& rh );
87  QgsRasterShader& operator=( const QgsRasterShader& rh );
88 };
89 #endif
Interface for all raster shaders.
QgsRasterShaderFunction * rasterShaderFunction()
The raster shade function applies a shader to a pixel at render time - typically used to render grays...
double maximumValue()
Return the maximum value for the raster shader.
const QgsRasterShaderFunction * rasterShaderFunction() const
double minimumValue()
Return the minimum value for the raster shader.