QGIS API Documentation  3.0.2-Girona (307d082)
qgsrastershaderfunction.h
Go to the documentation of this file.
1 /* **************************************************************************
2  qgsrastershaderfunction.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 QGSRASTERSHADERFUNCTION_H
21 #define QGSRASTERSHADERFUNCTION_H
22 
29 #include "qgis_core.h"
30 #include "qgis_sip.h"
31 #include <QColor>
32 #include <QPair>
33 
34 class CORE_EXPORT QgsRasterShaderFunction
35 {
36 #ifdef SIP_RUN
37 #include <qgscolorrampshader.h>
38 #endif
39 
40 
41 #ifdef SIP_RUN
43  if ( dynamic_cast<QgsColorRampShader *>( sipCpp ) != NULL )
44  sipType = sipType_QgsColorRampShader;
45  else
46  sipType = 0;
47  SIP_END
48 #endif
49 
50  public:
51  QgsRasterShaderFunction( double minimumValue = 0.0, double maximumValue = 255.0 );
52  virtual ~QgsRasterShaderFunction() = default;
53 
55  virtual void setMaximumValue( double );
56 
58  virtual void setMinimumValue( double );
59 
61  virtual bool shade( double value,
62  int *returnRedValue SIP_OUT,
63  int *returnGreenValue SIP_OUT,
64  int *returnBlueValue SIP_OUT,
65  int *returnAlpha SIP_OUT );
66 
68  virtual bool shade( double redValue,
69  double greenValue,
70  double blueValue,
71  double alphaValue,
72  int *returnRedValue SIP_OUT,
73  int *returnGreenValue SIP_OUT,
74  int *returnBlueValue SIP_OUT,
75  int *returnAlpha SIP_OUT );
76 
77  double minimumMaximumRange() const { return mMinimumMaximumRange; }
78 
79  double minimumValue() const { return mMinimumValue; }
80  double maximumValue() const { return mMaximumValue; }
81 
82  virtual void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const { Q_UNUSED( symbolItems ); }
83 
84  protected:
86  double mMaximumValue;
87 
89  double mMinimumValue;
90 
93 };
94 #endif
double mMinimumValue
User defineable minimum value for the shading function.
virtual void legendSymbologyItems(QList< QPair< QString, QColor > > &symbolItems) const
double mMaximumValue
User defineable maximum value for the shading function.
The raster shade function applies a shader to a pixel at render time - typically used to render grays...
#define SIP_END
Definition: qgis_sip.h:175
#define SIP_OUT
Definition: qgis_sip.h:51
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:165
double mMinimumMaximumRange
Minimum maximum range for the shading function.