Skip to content
Permalink
Browse files

fixed rendering algorithms applied twice

  • Loading branch information
blazek committed Jul 24, 2012
1 parent ce61402 commit 1bcd94724740ec8911daea41d5ed0a61c148c622
Showing with 0 additions and 40 deletions.
  1. +0 −40 src/core/raster/qgsmultibandcolorrenderer.cpp
@@ -291,46 +291,6 @@ void * QgsMultiBandColorRenderer::readBlock( int bandNo, QgsRectangle const & e
imageScanLine[j] = qRgba( currentOpacity * redVal, currentOpacity * greenVal, currentOpacity * blueVal, currentOpacity * 255 );
}

//stretch color values
if ( mRedContrastEnhancement )
{
redVal = mRedContrastEnhancement->enhanceContrast( redVal );
}
if ( mGreenContrastEnhancement )
{
greenVal = mGreenContrastEnhancement->enhanceContrast( greenVal );
}
if ( mBlueContrastEnhancement )
{
blueVal = mBlueContrastEnhancement->enhanceContrast( blueVal );
}

if ( mInvertColor )
{
redVal = 255 - redVal;
greenVal = 255 - greenVal;
blueVal = 255 - blueVal;
}

//opacity
currentOpacity = mOpacity;
if ( mRasterTransparency )
{
currentOpacity = mRasterTransparency->alphaValue( redDataVal, greenDataVal, blueDataVal, mOpacity * 255 ) / 255.0;
}
if ( mAlphaBand > 0 )
{
currentOpacity *= ( readValue( alphaData, transparencyType, currentRasterPos ) / 255.0 );
}

if ( doubleNear( currentOpacity, 255 ) )
{
imageScanLine[j] = qRgba( redVal, greenVal, blueVal, 255 );
}
else
{
imageScanLine[j] = qRgba( currentOpacity * redVal, currentOpacity * greenVal, currentOpacity * blueVal, currentOpacity * 255 );
}
++currentRasterPos;
}
}

0 comments on commit 1bcd947

Please sign in to comment.
You can’t perform that action at this time.