QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsrastershaderfunction.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsrastershaderfunction.h - description
3 -------------------
4begin : Fri Dec 28 2007
5copyright : (C) 2007 by Peter J. Ersts
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
29#include "qgis_core.h"
30#include "qgis_sip.h"
31
32#include <QColor>
33#include <QPair>
34
35class CORE_EXPORT QgsRasterShaderFunction
36{
37 //SIP_TYPEHEADER_INCLUDE( "qgscolorrampshader.h" );
38
39
40#ifdef SIP_RUN
42 if ( dynamic_cast<QgsColorRampShader *>( sipCpp ) != NULL )
43 sipType = sipType_QgsColorRampShader;
44 else
45 sipType = 0;
47#endif
48
49 public:
50 QgsRasterShaderFunction( double minimumValue = 0.0, double maximumValue = 255.0 );
51 virtual ~QgsRasterShaderFunction() = default;
52
58 virtual void setMaximumValue( double value );
59
65 virtual void setMinimumValue( double value );
66
76 virtual bool shade( double value,
77 int *returnRedValue SIP_OUT,
78 int *returnGreenValue SIP_OUT,
79 int *returnBlueValue SIP_OUT,
80 int *returnAlpha SIP_OUT ) const;
81
95 virtual bool shade( double redValue,
96 double greenValue,
97 double blueValue,
98 double alphaValue,
99 int *returnRedValue SIP_OUT,
100 int *returnGreenValue SIP_OUT,
101 int *returnBlueValue SIP_OUT,
102 int *returnAlpha SIP_OUT ) const;
103
104 double minimumMaximumRange() const { return mMinimumMaximumRange; }
105
111 double minimumValue() const { return mMinimumValue; }
112
118 double maximumValue() const { return mMaximumValue; }
119
123 virtual void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const { Q_UNUSED( symbolItems ) }
124
129 int labelPrecision() const;
130
135 void setLabelPrecision( int labelPrecision );
136
137 protected:
140
143
146
149
150};
151#endif
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
double mMinimumValue
User defineable minimum value for the shading function.
QgsRasterShaderFunction(double minimumValue=0.0, double maximumValue=255.0)
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 bool shade(double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlpha) const
Generates an new RGBA value based on one input value.
virtual void setMaximumValue(double value)
Sets the maximum value for the raster shader.
virtual ~QgsRasterShaderFunction()=default
virtual void setMinimumValue(double value)
Sets the minimum value for the raster shader.
int mLabelPrecision
Label precision.
double minimumValue() const
Returns the maximum value for the raster shader.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:199
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_END
Definition qgis_sip.h:216