QGIS API Documentation 3.41.0-Master (d5b93354e9c)
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
29#include "qgis_core.h"
30#include "qgis_sip.h"
31#include <QColor>
32#include <QPair>
33
34class CORE_EXPORT QgsRasterShaderFunction
35{
36 //SIP_TYPEHEADER_INCLUDE( "qgscolorrampshader.h" );
37
38
39#ifdef SIP_RUN
41 if ( dynamic_cast<QgsColorRampShader *>( sipCpp ) != NULL )
42 sipType = sipType_QgsColorRampShader;
43 else
44 sipType = 0;
46#endif
47
48 public:
49 QgsRasterShaderFunction( double minimumValue = 0.0, double maximumValue = 255.0 );
50 virtual ~QgsRasterShaderFunction() = default;
51
57 virtual void setMaximumValue( double value );
58
64 virtual void setMinimumValue( double value );
65
75 virtual bool shade( double value,
76 int *returnRedValue SIP_OUT,
77 int *returnGreenValue SIP_OUT,
78 int *returnBlueValue SIP_OUT,
79 int *returnAlpha SIP_OUT ) const;
80
94 virtual bool shade( double redValue,
95 double greenValue,
96 double blueValue,
97 double alphaValue,
98 int *returnRedValue SIP_OUT,
99 int *returnGreenValue SIP_OUT,
100 int *returnBlueValue SIP_OUT,
101 int *returnAlpha SIP_OUT ) const;
102
103 double minimumMaximumRange() const { return mMinimumMaximumRange; }
104
110 double minimumValue() const { return mMinimumValue; }
111
117 double maximumValue() const { return mMaximumValue; }
118
122 virtual void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems SIP_OUT ) const { Q_UNUSED( symbolItems ) }
123
128 int labelPrecision() const;
129
134 void setLabelPrecision( int labelPrecision );
135
136 protected:
139
142
145
147 int mLabelPrecision = 6;
148
149};
150#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:191
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_END
Definition qgis_sip.h:208