QGIS API Documentation  2.99.0-Master (9caa722)
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 
28 #include "qgis_core.h"
29 #include "qgis_sip.h"
30 #include <QColor>
31 #include <QPair>
32 
33 class CORE_EXPORT QgsRasterShaderFunction
34 {
35 #ifdef SIP_RUN
36 #include <qgscolorrampshader.h>
37 #endif
38 
39 
40 #ifdef SIP_RUN
42  if ( dynamic_cast<QgsColorRampShader *>( sipCpp ) != NULL )
43  sipType = sipType_QgsColorRampShader;
44  else
45  sipType = 0;
46  SIP_END
47 #endif
48 
49  public:
50  QgsRasterShaderFunction( double minimumValue = 0.0, double maximumValue = 255.0 );
51  virtual ~QgsRasterShaderFunction() = default;
52 
54  virtual void setMaximumValue( double );
55 
57  virtual void setMinimumValue( double );
58 
60  virtual bool shade( double value,
61  int *returnRedValue SIP_OUT,
62  int *returnGreenValue SIP_OUT,
63  int *returnBlueValue SIP_OUT,
64  int *returnAlpha SIP_OUT );
65 
67  virtual bool shade( double redValue,
68  double greenValue,
69  double blueValue,
70  double alphaValue,
71  int *returnRedValue SIP_OUT,
72  int *returnGreenValue SIP_OUT,
73  int *returnBlueValue SIP_OUT,
74  int *returnAlpha SIP_OUT );
75 
76  double minimumMaximumRange() const { return mMinimumMaximumRange; }
77 
78  double minimumValue() const { return mMinimumValue; }
79  double maximumValue() const { return mMaximumValue; }
80 
81  virtual void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const { Q_UNUSED( symbolItems ); }
82 
83  protected:
85  double mMaximumValue;
86 
88  double mMinimumValue;
89 
92 };
93 #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.