QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsrastershader.h
Go to the documentation of this file.
1/* **************************************************************************
2 qgsrastershader.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 QGSRASTERSHADER_H
21#define QGSRASTERSHADER_H
22
23#include "qgis_core.h"
24#include "qgis_sip.h"
25#include "qgsreadwritecontext.h"
26
27class QDomDocument;
28class QDomElement;
30
35class CORE_EXPORT QgsRasterShader
36{
37
38 public:
39 QgsRasterShader( double minimumValue = 0.0, double maximumValue = 255.0 );
40
41 QgsRasterShader( const QgsRasterShader &rh ) = delete;
43
44 /*
45 *
46 * Non-Static Inline methods
47 *
48 */
49
55 double maximumValue() const { return mMaximumValue; }
56
62 double minimumValue() const { return mMinimumValue; }
63
64 QgsRasterShaderFunction *rasterShaderFunction() { return mRasterShaderFunction.get(); }
65 const QgsRasterShaderFunction *rasterShaderFunction() const SIP_SKIP { return mRasterShaderFunction.get(); }
66
67 /*
68 *
69 * Non-Static methods
70 *
71 */
72
83 bool shade( double value,
84 int *returnRedValue SIP_OUT,
85 int *returnGreenValue SIP_OUT,
86 int *returnBlueValue SIP_OUT,
87 int *returnAlpha SIP_OUT ) const;
88
101 bool shade( double redValue,
102 double greenValue,
103 double blueValue,
104 double alphaValue,
105 int *returnRedValue SIP_OUT,
106 int *returnGreenValue SIP_OUT,
107 int *returnBlueValue SIP_OUT,
108 int *returnAlpha SIP_OUT ) const;
109
114 void setRasterShaderFunction( QgsRasterShaderFunction *function SIP_TRANSFER );
115
121 void setMaximumValue( double value );
122
128 void setMinimumValue( double value );
129
133 void writeXml( QDomDocument &doc, QDomElement &parent, const QgsReadWriteContext &context = QgsReadWriteContext() ) const;
134
138 void readXml( const QDomElement &elem, const QgsReadWriteContext &context = QgsReadWriteContext() );
139
140 private:
141#ifdef SIP_RUN
142 QgsRasterShader( const QgsRasterShader &rh );
143#endif
144
146 double mMinimumValue;
147
149 double mMaximumValue;
150
152 std::unique_ptr< QgsRasterShaderFunction > mRasterShaderFunction;
153
154};
155#endif
The raster shade function applies a shader to a pixel at render time - typically used to render grays...
Interface for all raster shaders.
double maximumValue() const
Returns the maximum value for the raster shader.
QgsRasterShader & operator=(const QgsRasterShader &rh)=delete
QgsRasterShader(const QgsRasterShader &rh)=delete
const QgsRasterShaderFunction * rasterShaderFunction() const
double minimumValue() const
Returns the minimum value for the raster shader.
QgsRasterShaderFunction * rasterShaderFunction()
The class is used as a container of context for various read/write operations on other objects.
#define SIP_SKIP
Definition qgis_sip.h:126
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_OUT
Definition qgis_sip.h:58