Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
auto set alpha band
  • Loading branch information
blazek committed Oct 4, 2012
1 parent f3acfda commit c8a05c1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit c8a05c1

Please sign in to comment.