QGIS API Documentation  3.23.0-Master (22c16f2067)
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 
130  int labelPrecision() const;
131 
136  void setLabelPrecision( int labelPrecision );
137 
138  protected:
141 
144 
147 
149  int mLabelPrecision = 6;
150 
151 };
152 #endif
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
The raster shade function applies a shader to a pixel at render time - typically used to render grays...
double mMinimumValue
User defineable minimum value for the shading function.
double mMinimumMaximumRange
Minimum maximum range for the shading function.
virtual void legendSymbologyItems(QList< QPair< QString, QColor > > &symbolItems) const
Returns legend symbology items if provided by renderer.
double maximumValue() const
Returns the minimum value for the raster shader.
double mMaximumValue
User defineable maximum value for the shading function.
virtual ~QgsRasterShaderFunction()=default
double minimumValue() const
Returns the maximum value for the raster shader.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition: qgis_sip.h:177
#define SIP_OUT
Definition: qgis_sip.h:58
#define SIP_END
Definition: qgis_sip.h:194