25 #include <QDomDocument>
26 #include <QDomElement>
29 : mMinimumValue( minimumValue )
30 , mMaximumValue( maximumValue )
36 bool QgsRasterShader::shade(
double value,
int *returnRedValue,
int *returnGreenValue,
int *returnBlueValue,
int *returnAlpha )
38 if ( mRasterShaderFunction )
40 return mRasterShaderFunction->shade( value, returnRedValue, returnGreenValue, returnBlueValue, returnAlpha );
46 bool QgsRasterShader::shade(
double redValue,
double greenValue,
double blueValue,
double alphaValue,
int *returnRedValue,
int *returnGreenValue,
int *returnBlueValue,
int *returnAlphaValue )
48 if ( mRasterShaderFunction )
50 return mRasterShaderFunction->shade( redValue, greenValue, blueValue, alphaValue, returnRedValue, returnGreenValue, returnBlueValue, returnAlphaValue );
60 if ( mRasterShaderFunction.get() ==
function )
65 mRasterShaderFunction.reset(
function );
73 mMaximumValue = value;
74 if ( mRasterShaderFunction )
76 mRasterShaderFunction->setMaximumValue( value );
84 mMinimumValue = value;
85 if ( mRasterShaderFunction )
87 mRasterShaderFunction->setMinimumValue( value );
93 if ( parent.isNull() || !mRasterShaderFunction )
98 QDomElement rasterShaderElem = doc.createElement( QStringLiteral(
"rastershader" ) );
100 if ( colorRampShader )
102 rasterShaderElem.appendChild( colorRampShader->
writeXml( doc ) );
104 parent.appendChild( rasterShaderElem );
110 QDomElement colorRampShaderElem = elem.firstChildElement( QStringLiteral(
"colorrampshader" ) );
111 if ( !colorRampShaderElem.isNull() )
114 colorRampShader->
readXml( colorRampShaderElem );