Skip to content
Permalink
Browse files

raster renderers clone fix - fixes saves with transparency

  • Loading branch information
blazek committed Oct 3, 2012
1 parent fe6a8a3 commit f2eb092ebf1cc1864f79f8af98cbdbece8d2bca9
@@ -55,6 +55,11 @@ QgsRasterInterface * QgsMultiBandColorRenderer::clone() const
{
renderer->setBlueContrastEnhancement( new QgsContrastEnhancement( *mBlueContrastEnhancement ) );
}
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );

return renderer;
}

@@ -37,6 +37,10 @@ QgsPalettedRasterRenderer::~QgsPalettedRasterRenderer()
QgsRasterInterface * QgsPalettedRasterRenderer::clone() const
{
QgsPalettedRasterRenderer * renderer = new QgsPalettedRasterRenderer( 0, mBandNumber, colors(), mNColors );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );
return renderer;
}

@@ -34,6 +34,10 @@ QgsSingleBandColorDataRenderer::~QgsSingleBandColorDataRenderer()
QgsRasterInterface * QgsSingleBandColorDataRenderer::clone() const
{
QgsSingleBandColorDataRenderer * renderer = new QgsSingleBandColorDataRenderer( 0, mBand );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );
return renderer;
}

@@ -35,6 +35,10 @@ QgsSingleBandGrayRenderer::~QgsSingleBandGrayRenderer()
QgsRasterInterface * QgsSingleBandGrayRenderer::clone() const
{
QgsSingleBandGrayRenderer * renderer = new QgsSingleBandGrayRenderer( 0, mGrayBand );
renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );
if ( mContrastEnhancement )
{
renderer->setContrastEnhancement( new QgsContrastEnhancement( *mContrastEnhancement ) );
@@ -56,6 +56,10 @@ QgsRasterInterface * QgsSingleBandPseudoColorRenderer::clone() const
}
QgsSingleBandPseudoColorRenderer * renderer = new QgsSingleBandPseudoColorRenderer( 0, mBand, shader );

renderer->setOpacity( mOpacity );
renderer->setAlphaBand( mAlphaBand );
renderer->setInvertColor( mInvertColor );
renderer->setRasterTransparency( mRasterTransparency );

return renderer;
}

0 comments on commit f2eb092

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