Skip to content
Permalink
Browse files

auto set alpha band

  • Loading branch information
blazek committed Oct 4, 2012
1 parent f3acfda commit c8a05c10823e1308b37aa03223f0117f01fde942
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/core/raster/qgsrasterlayer.cpp
@@ -1847,6 +1847,19 @@ void QgsRasterLayer::setDataProvider( QString const & provider )
setDrawingStyle( SingleBandGray ); //sensible default
}

// Auto set alpha band
for ( int bandNo = 1; bandNo <= mDataProvider->bandCount(); bandNo++ )
{
if ( mDataProvider->colorInterpretation( bandNo ) == QgsRasterDataProvider::AlphaBand )
{
if ( mPipe.renderer() )
{
mPipe.renderer()->setAlphaBand( bandNo );
}
break;
}
}

//resampler (must be after renderer)
QgsRasterResampleFilter * resampleFilter = new QgsRasterResampleFilter();
mPipe.set( resampleFilter );

0 comments on commit c8a05c1

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