QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsrastershaderfunction.cpp
Go to the documentation of this file.
1 /* **************************************************************************
2  qgsrastershaderfunction.cpp - 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 #include "qgslogger.h"
19 
21 
22 QgsRasterShaderFunction::QgsRasterShaderFunction( double minimumValue, double maximumValue )
23  : mMaximumValue( maximumValue )
24  , mMinimumValue( minimumValue )
25  , mMinimumMaximumRange( mMaximumValue - mMinimumValue )
26 {
27  QgsDebugMsgLevel( QStringLiteral( "entered." ), 4 );
28 }
29 
31 {
32  QgsDebugMsgLevel( "value = " + QString::number( value ), 4 );
33 
34  mMaximumValue = value;
36 }
37 
39 {
40  QgsDebugMsgLevel( "value = " + QString::number( value ), 4 );
41 
42  mMinimumValue = value;
44 }
45 
46 bool QgsRasterShaderFunction::shade( double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlphaValue ) const
47 {
48  Q_UNUSED( value )
49 
50  *returnRedValue = 0;
51  *returnGreenValue = 0;
52  *returnBlueValue = 0;
53  *returnAlphaValue = 0;
54 
55  return false;
56 }
57 
58 bool QgsRasterShaderFunction::shade( double redValue, double greenValue, double blueValue, double alphaValue, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlphaValue ) const
59 {
60  Q_UNUSED( redValue )
61  Q_UNUSED( greenValue )
62  Q_UNUSED( blueValue )
63  Q_UNUSED( alphaValue )
64 
65  *returnRedValue = 0;
66  *returnGreenValue = 0;
67  *returnBlueValue = 0;
68  *returnAlphaValue = 0;
69 
70  return false;
71 }
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
QgsRasterShaderFunction::mMinimumValue
double mMinimumValue
User defineable minimum value for the shading function.
Definition: qgsrastershaderfunction.h:131
qgsrastershaderfunction.h
QgsRasterShaderFunction::QgsRasterShaderFunction
QgsRasterShaderFunction(double minimumValue=0.0, double maximumValue=255.0)
Definition: qgsrastershaderfunction.cpp:22
QgsRasterShaderFunction::setMaximumValue
virtual void setMaximumValue(double value)
Sets the maximum value for the raster shader.
Definition: qgsrastershaderfunction.cpp:30
QgsRasterShaderFunction::mMaximumValue
double mMaximumValue
User defineable maximum value for the shading function.
Definition: qgsrastershaderfunction.h:128
qgslogger.h
QgsRasterShaderFunction::shade
virtual bool shade(double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlpha) const
Generates an new RGBA value based on one input value.
Definition: qgsrastershaderfunction.cpp:46
QgsRasterShaderFunction::mMinimumMaximumRange
double mMinimumMaximumRange
Minimum maximum range for the shading function.
Definition: qgsrastershaderfunction.h:134
QgsRasterShaderFunction::setMinimumValue
virtual void setMinimumValue(double value)
Sets the minimum value for the raster shader.
Definition: qgsrastershaderfunction.cpp:38