Skip to content
Permalink
Browse files

insert raster resampler to pipe

  • Loading branch information
blazek committed Jul 17, 2012
1 parent 6af1f60 commit 3ed53c2207ed04adcdcfab9f7e7089e11e05022d
Showing with 11 additions and 8 deletions.
  1. +10 −7 src/core/raster/qgsrasterlayer.cpp
  2. +1 −1 src/core/raster/qgsrasterlayer.h
@@ -821,12 +821,6 @@ void QgsRasterLayer::draw( QPainter * theQPainter,
//

QgsRasterProjector *projector = mPipe.projector();
// TODO: add in init?
if ( !projector )
{
projector = new QgsRasterProjector;
mPipe.set( projector );
}

// TODO add a method to interface to get provider and get provider
// params in QgsRasterProjector
@@ -1786,6 +1780,14 @@ void QgsRasterLayer::setDataProvider( QString const & provider )
setDrawingStyle( SingleBandGray ); //sensible default
}

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

// projector (may be anywhere in pipe)
QgsRasterProjector * projector = new QgsRasterProjector;
mPipe.set( projector );

// Store timestamp
// TODO move to provider
mLastModified = lastModified( mDataSource );
@@ -2109,6 +2111,7 @@ void QgsRasterLayer::setRenderer( QgsRasterRenderer* theRenderer )
}

// not sure if we want it
/*
void QgsRasterLayer::setResampleFilter( QgsRasterResampleFilter* resampleFilter )
{
QgsDebugMsg( "Entered" );
@@ -2119,7 +2122,7 @@ void QgsRasterLayer::setResampleFilter( QgsRasterResampleFilter* resampleFilter
QgsDebugMsg( "Cannot set resample filter." );
}
}

*/
void QgsRasterLayer::showProgress( int theValue )
{
emit progressUpdate( theValue );
@@ -354,7 +354,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
QgsRasterRenderer* renderer() const { return mPipe.renderer(); }

/**Set raster resample filter. Takes ownership of the resample filter object*/
void setResampleFilter( QgsRasterResampleFilter* resampleFilter );
//void setResampleFilter( QgsRasterResampleFilter* resampleFilter );
QgsRasterResampleFilter * resampleFilter() const { return mPipe.resampleFilter(); }

/** Get raster pipe */

0 comments on commit 3ed53c2

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