QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 theMinimumValue, double theMaximumValue )
23 {
24  QgsDebugMsgLevel( "entered.", 4 );
25 
26  mMinimumValue = theMinimumValue;
27  mMaximumValue = theMaximumValue;
29 }
30 
37 {
38  QgsDebugMsgLevel( "value = " + QString::number( theValue ), 4 );
39 
40  mMaximumValue = theValue;
42 }
43 
50 {
51  QgsDebugMsgLevel( "value = " + QString::number( theValue ), 4 );
52 
53  mMinimumValue = theValue;
55 }
56 
67 bool QgsRasterShaderFunction::shade( double theValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue, int* theReturnAlphaValue )
68 {
69  Q_UNUSED( theValue );
70 
71  *theReturnRedValue = 0;
72  *theReturnGreenValue = 0;
73  *theReturnBlueValue = 0;
74  *theReturnAlphaValue = 0;
75 
76  return false;
77 }
78 
93 bool QgsRasterShaderFunction::shade( double theRedValue, double theGreenValue, double theBlueValue, double theAlphaValue, int* theReturnRedValue, int* theReturnGreenValue, int* theReturnBlueValue, int *theReturnAlphaValue )
94 {
95  Q_UNUSED( theRedValue );
96  Q_UNUSED( theGreenValue );
97  Q_UNUSED( theBlueValue );
98  Q_UNUSED( theAlphaValue );
99 
100  *theReturnRedValue = 0;
101  *theReturnGreenValue = 0;
102  *theReturnBlueValue = 0;
103  *theReturnAlphaValue = 0;
104 
105  return false;
106 }
virtual bool shade(double, int *, int *, int *, int *)
generates and new RGBA value based on one input value
double mMinimumValue
User defineable minimum value for the shading function.
QString number(int n, int base)
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:34
double mMaximumValue
User defineable maximum value for the shading function.
QgsRasterShaderFunction(double theMinimumValue=0.0, double theMaximumValue=255.0)
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.