QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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 public:
38 QgsRasterShader( double minimumValue = 0.0, double maximumValue = 255.0 );
39
40 QgsRasterShader( const QgsRasterShader &rh ) = delete;
42
43 /*
44 *
45 * Non-Static Inline methods
46 *
47 */
48
54 double maximumValue() const { return mMaximumValue; }
55
61 double minimumValue() const { return mMinimumValue; }
62
63 QgsRasterShaderFunction *rasterShaderFunction() { return mRasterShaderFunction.get(); }
64 const QgsRasterShaderFunction *rasterShaderFunction() const SIP_SKIP { return mRasterShaderFunction.get(); }
65
66 /*
67 *
68 * Non-Static methods
69 *
70 */
71
82 bool shade( double value, int *returnRedValue SIP_OUT, int *returnGreenValue SIP_OUT, int *returnBlueValue SIP_OUT, int *returnAlpha SIP_OUT ) const;
83
96 bool shade(
97 double redValue, double greenValue, double blueValue, double alphaValue, int *returnRedValue SIP_OUT, int *returnGreenValue SIP_OUT, int *returnBlueValue SIP_OUT, int *returnAlpha SIP_OUT
98 ) const;
99
104 void setRasterShaderFunction( QgsRasterShaderFunction *function SIP_TRANSFER );
105
111 void setMaximumValue( double value );
112
118 void setMinimumValue( double value );
119
123 void writeXml( QDomDocument &doc, QDomElement &parent, const QgsReadWriteContext &context = QgsReadWriteContext() ) const;
124
128 void readXml( const QDomElement &elem, const QgsReadWriteContext &context = QgsReadWriteContext() );
129
130 private:
131#ifdef SIP_RUN
132 QgsRasterShader( const QgsRasterShader &rh );
133#endif
134
136 double mMinimumValue;
137
139 double mMaximumValue;
140
142 std::unique_ptr< QgsRasterShaderFunction > mRasterShaderFunction;
143};
144#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
QgsRasterShader(double minimumValue=0.0, double maximumValue=255.0)
double minimumValue() const
Returns the minimum value for the raster shader.
QgsRasterShaderFunction * rasterShaderFunction()
A container for the context for various read/write operations on objects.
#define SIP_SKIP
Definition qgis_sip.h:133
#define SIP_TRANSFER
Definition qgis_sip.h:35
#define SIP_OUT
Definition qgis_sip.h:57