33 double myPixelValue = theValue;
47 if (( myPixelValue >= mClassBreakMin1 ) && ( myPixelValue < mClassBreakMax1 ) )
49 *theReturnRedValue = 0;
50 *theReturnGreenValue = static_cast <
int >((( 255 /
mMinimumMaximumRange ) * ( myPixelValue - mClassBreakMin1 ) ) * 3 );
51 *theReturnBlueValue = 255;
54 else if (( myPixelValue >= mClassBreakMin2 ) && ( myPixelValue < mClassBreakMax2 ) )
56 *theReturnRedValue = static_cast <
int >((( 255 /
mMinimumMaximumRange ) * (( myPixelValue - mClassBreakMin2 ) / 1 ) ) * 3 );
57 *theReturnGreenValue = 255;
58 *theReturnBlueValue = static_cast <
int >( 255 - ((( 255 /
mMinimumMaximumRange ) * (( myPixelValue - mClassBreakMin2 ) / 1 ) ) * 3 ) );
63 *theReturnRedValue = 255;
64 *theReturnGreenValue = static_cast <
int >( 255 - ((( 255 /
mMinimumMaximumRange ) * (( myPixelValue - mClassBreakMin3 ) / 1 ) * 3 ) ) );
65 *theReturnBlueValue = 0;
71 bool QgsPseudoColorShader::shade(
double theRedValue,
double theGreenValue,
double theBlueValue,
int* theReturnRedValue,
int* theReturnGreenValue,
int* theReturnBlueValue )
73 Q_UNUSED( theRedValue );
74 Q_UNUSED( theGreenValue );
75 Q_UNUSED( theBlueValue );
77 *theReturnRedValue = 0;
78 *theReturnGreenValue = 0;
79 *theReturnBlueValue = 0;
84 void QgsPseudoColorShader::setClassBreaks()
89 mClassBreakMax1 = mClassBreakMin1 + mBreakSize;
90 mClassBreakMin2 = mClassBreakMax1;
91 mClassBreakMax2 = mClassBreakMin2 + mBreakSize;
92 mClassBreakMin3 = mClassBreakMax2;