QGIS API Documentation  2.99.0-Master (0a63d1f)
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 #include "qgis_core.h"
24 
25 class QDomDocument;
26 class QDomElement;
28 
32 class CORE_EXPORT QgsRasterShader
33 {
34 
35  public:
36  QgsRasterShader( double theMinimumValue = 0.0, double theMaximumValue = 255.0 );
37  ~QgsRasterShader();
38 
40  QgsRasterShader( const QgsRasterShader& rh ) = delete;
42  QgsRasterShader& operator=( const QgsRasterShader& rh ) = delete;
43 
44  /*
45  *
46  * Non-Static Inline methods
47  *
48  */
50  double maximumValue() { return mMaximumValue; }
51 
53  double minimumValue() { return mMinimumValue; }
54 
55  QgsRasterShaderFunction* rasterShaderFunction() { return mRasterShaderFunction; }
56  const QgsRasterShaderFunction* rasterShaderFunction() const { return mRasterShaderFunction; }
57 
58  /*
59  *
60  * Non-Static methods
61  *
62  */
64  bool shade( double, int*, int*, int*, int* );
65 
67  bool shade( double, double, double, double, int*, int*, int*, int* );
68 
71  void setRasterShaderFunction( QgsRasterShaderFunction* );
72 
74  void setMaximumValue( double );
75 
77  void setMinimumValue( double );
78 
82  void writeXml( QDomDocument& doc, QDomElement& parent ) const;
83 
87  void readXml( const QDomElement& elem );
88 
89  private:
91  double mMinimumValue;
92 
94  double mMaximumValue;
95 
97  QgsRasterShaderFunction* mRasterShaderFunction;
98 
99 };
100 #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.