QGIS API Documentation  2.99.0-Master (d55fa22)
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 minimumValue = 0.0, double maximumValue = 255.0 );
37 
39  QgsRasterShader( const QgsRasterShader &rh ) = delete;
41  QgsRasterShader &operator=( const QgsRasterShader &rh ) = delete;
42 
43  /*
44  *
45  * Non-Static Inline methods
46  *
47  */
49  double maximumValue() { return mMaximumValue; }
50 
52  double minimumValue() { return mMinimumValue; }
53 
54  QgsRasterShaderFunction *rasterShaderFunction() { return mRasterShaderFunction.get(); }
55  const QgsRasterShaderFunction *rasterShaderFunction() const { return mRasterShaderFunction.get(); }
56 
57  /*
58  *
59  * Non-Static methods
60  *
61  */
63  bool shade( double, int *, int *, int *, int * );
64 
66  bool shade( double, double, double, double, int *, int *, int *, int * );
67 
70  void setRasterShaderFunction( QgsRasterShaderFunction * );
71 
73  void setMaximumValue( double );
74 
76  void setMinimumValue( double );
77 
81  void writeXml( QDomDocument &doc, QDomElement &parent ) const;
82 
86  void readXml( const QDomElement &elem );
87 
88  private:
90  double mMinimumValue;
91 
93  double mMaximumValue;
94 
96  std::unique_ptr< QgsRasterShaderFunction > mRasterShaderFunction;
97 
98 };
99 #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.