QGIS API Documentation  2.99.0-Master (3450a9f)
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( "entered.", 4 );
28 }
29 
36 {
37  QgsDebugMsgLevel( "value = " + QString::number( value ), 4 );
38 
39  mMaximumValue = value;
41 }
42 
49 {
50  QgsDebugMsgLevel( "value = " + QString::number( value ), 4 );
51 
52  mMinimumValue = value;
54 }
55 
66 bool QgsRasterShaderFunction::shade( double value, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlphaValue )
67 {
68  Q_UNUSED( value );
69 
70  *returnRedValue = 0;
71  *returnGreenValue = 0;
72  *returnBlueValue = 0;
73  *returnAlphaValue = 0;
74 
75  return false;
76 }
77 
92 bool QgsRasterShaderFunction::shade( double redValue, double greenValue, double blueValue, double alphaValue, int *returnRedValue, int *returnGreenValue, int *returnBlueValue, int *returnAlphaValue )
93 {
94  Q_UNUSED( redValue );
95  Q_UNUSED( greenValue );
96  Q_UNUSED( blueValue );
97  Q_UNUSED( alphaValue );
98 
99  *returnRedValue = 0;
100  *returnGreenValue = 0;
101  *returnBlueValue = 0;
102  *returnAlphaValue = 0;
103 
104  return false;
105 }
virtual bool shade(double, int *, int *, int *, int *)
generates and new RGBA value based on one input value
QgsRasterShaderFunction(double minimumValue=0.0, double maximumValue=255.0)
double mMinimumValue
User defineable minimum value for the shading function.
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:37
double mMaximumValue
User defineable maximum value for the shading function.
virtual void setMinimumValue(double)
Return the minimum value.
double mMinimumMaximumRange
Minimum maximum range for the shading function.
virtual void setMaximumValue(double)
Set the maximum value.