QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 
59  virtual void setMaximumValue( double value );
60 
66  virtual void setMinimumValue( double value );
67 
77  virtual bool shade( double value,
78  int *returnRedValue SIP_OUT,
79  int *returnGreenValue SIP_OUT,
80  int *returnBlueValue SIP_OUT,
81  int *returnAlpha SIP_OUT ) const;
82 
96  virtual bool shade( double redValue,
97  double greenValue,
98  double blueValue,
99  double alphaValue,
100  int *returnRedValue SIP_OUT,
101  int *returnGreenValue SIP_OUT,
102  int *returnBlueValue SIP_OUT,
103  int *returnAlpha SIP_OUT ) const;
104 
105  double minimumMaximumRange() const { return mMinimumMaximumRange; }
106 
112  double minimumValue() const { return mMinimumValue; }
113 
119  double maximumValue() const { return mMaximumValue; }
120 
124  virtual void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const { Q_UNUSED( symbolItems ) }
125 
126  protected:
129 
132 
135 };
136 #endif
QgsRasterShaderFunction::legendSymbologyItems
virtual void legendSymbologyItems(QList< QPair< QString, QColor > > &symbolItems) const
Returns legend symbology items if provided by renderer.
Definition: qgsrastershaderfunction.h:124
SIP_OUT
#define SIP_OUT
Definition: qgis_sip.h:58
QgsRasterShaderFunction::maximumValue
double maximumValue() const
Returns the minimum value for the raster shader.
Definition: qgsrastershaderfunction.h:119
qgscolorrampshader.h
QgsRasterShaderFunction::mMinimumValue
double mMinimumValue
User defineable minimum value for the shading function.
Definition: qgsrastershaderfunction.h:131
QgsColorRampShader
Definition: qgscolorrampshader.h:39
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:172
QgsRasterShaderFunction::mMaximumValue
double mMaximumValue
User defineable maximum value for the shading function.
Definition: qgsrastershaderfunction.h:128
qgis_sip.h
QgsRasterShaderFunction::minimumValue
double minimumValue() const
Returns the maximum value for the raster shader.
Definition: qgsrastershaderfunction.h:112
QgsRasterShaderFunction::minimumMaximumRange
double minimumMaximumRange() const
Definition: qgsrastershaderfunction.h:105
QgsRasterShaderFunction
Definition: qgsrastershaderfunction.h:34
SIP_END
#define SIP_END
Definition: qgis_sip.h:189
QgsRasterShaderFunction::mMinimumMaximumRange
double mMinimumMaximumRange
Minimum maximum range for the shading function.
Definition: qgsrastershaderfunction.h:134