Skip to content

Commit 71f3cfe

Browse files
committedJul 1, 2012
re enabled resampling, clean up
1 parent db7f9a5 commit 71f3cfe

13 files changed

+102
-114
lines changed
 

‎src/core/qgsrasterdataprovider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class QByteArray;
4040

4141
#define TINY_VALUE std::numeric_limits<double>::epsilon() * 20
4242

43-
4443
/** \ingroup core
4544
* Base class for raster data providers.
4645
*
@@ -105,6 +104,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
105104

106105
virtual ~QgsRasterDataProvider() {};
107106

107+
QgsRasterInterface * srcInput() { return this; }
108108

109109
/**
110110
* Add the list of WMS layer names to be rendered by this server

‎src/core/qgsrasterprojector.cpp

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ QgsRasterProjector::QgsRasterProjector(
3434
, mExtent( theExtent )
3535
, mDestRows( theDestRows ), mDestCols( theDestCols )
3636
, mMaxSrcXRes( theMaxSrcXRes ), mMaxSrcYRes( theMaxSrcYRes )
37+
, pHelperTop( 0 ), pHelperBottom( 0 )
3738
{
3839
QgsDebugMsg( "Entered" );
3940
QgsDebugMsg( "theDestExtent = " + theDestExtent.toString() );
@@ -52,21 +53,22 @@ QgsRasterProjector::QgsRasterProjector(
5253
, mCoordinateTransform( theDestCRS, theSrcCRS )
5354
, mExtent( theExtent )
5455
, mMaxSrcXRes( theMaxSrcXRes ), mMaxSrcYRes( theMaxSrcYRes )
56+
, pHelperTop( 0 ), pHelperBottom( 0 )
5557
{
5658
QgsDebugMsg( "Entered" );
5759
}
5860

5961
QgsRasterProjector::QgsRasterProjector()
6062
: QgsRasterInterface( 0, QgsRasterInterface::ProjectorRole )
63+
, pHelperTop( 0 ), pHelperBottom( 0 )
6164
{
6265
QgsDebugMsg( "Entered" );
6366
}
6467

6568
QgsRasterProjector::~QgsRasterProjector()
6669
{
67-
//delete mCoordinateTransform;
68-
//delete pHelperTop;
69-
//delete pHelperBottom;
70+
delete pHelperTop;
71+
delete pHelperBottom;
7072
}
7173

7274
void QgsRasterProjector::setCRS( QgsCoordinateReferenceSystem theSrcCRS, QgsCoordinateReferenceSystem theDestCRS )
@@ -79,9 +81,12 @@ void QgsRasterProjector::setCRS( QgsCoordinateReferenceSystem theSrcCRS, QgsCoor
7981

8082
void QgsRasterProjector::calc()
8183
{
84+
QgsDebugMsg( "Entered" );
8285
mCPMatrix.clear();
83-
//delete pHelperTop;
84-
//delete pHelperBottom;
86+
delete pHelperTop;
87+
pHelperTop = 0;
88+
delete pHelperBottom;
89+
pHelperBottom = 0;
8590

8691
mDestXRes = mDestExtent.width() / ( mDestCols );
8792
mDestYRes = mDestExtent.height() / ( mDestRows );
@@ -328,6 +333,7 @@ void QgsRasterProjector::calcHelper( int theMatrixRow, QgsPoint *thePoints )
328333
}
329334
void QgsRasterProjector::nextHelper()
330335
{
336+
// We just switch pHelperTop and pHelperBottom, memory is not lost
331337
QgsPoint *tmp;
332338
tmp = pHelperTop;
333339
pHelperTop = pHelperBottom;
@@ -345,23 +351,33 @@ void QgsRasterProjector::srcRowCol( int theDestRow, int theDestCol, int *theSrcR
345351

346352
void QgsRasterProjector::preciseSrcRowCol( int theDestRow, int theDestCol, int *theSrcRow, int *theSrcCol )
347353
{
348-
//QgsDebugMsg( QString( "theDestRow = %1" ).arg(theDestRow) );
349-
//QgsDebugMsg( QString( "theDestRow = %1 mDestExtent.yMaximum() = %2 mDestYRes = %3" ).arg(theDestRow).arg(mDestExtent.yMaximum()).arg(mDestYRes) );
354+
#ifdef QGISDEBUG
355+
QgsDebugMsgLevel( QString( "theDestRow = %1" ).arg( theDestRow ), 5 );
356+
QgsDebugMsgLevel( QString( "theDestRow = %1 mDestExtent.yMaximum() = %2 mDestYRes = %3" ).arg( theDestRow ).arg( mDestExtent.yMaximum() ).arg( mDestYRes ), 5 );
357+
#endif
350358

351359
// Get coordinate of center of destination cell
352360
double x = mDestExtent.xMinimum() + ( theDestCol + 0.5 ) * mDestXRes;
353361
double y = mDestExtent.yMaximum() - ( theDestRow + 0.5 ) * mDestYRes;
354362
double z = 0;
355363

356-
//QgsDebugMsg( QString( "x = %1 y = %2" ).arg(x).arg(y) );
364+
#ifdef QGISDEBUG
365+
QgsDebugMsgLevel( QString( "x = %1 y = %2" ).arg( x ).arg( y ), 5 );
366+
#endif
367+
357368
mCoordinateTransform.transformInPlace( x, y, z );
358-
//QgsDebugMsg( QString( "x = %1 y = %2" ).arg(x).arg(y) );
369+
370+
#ifdef QGISDEBUG
371+
QgsDebugMsgLevel( QString( "x = %1 y = %2" ).arg( x ).arg( y ), 5 );
372+
#endif
359373

360374
// Get source row col
361375
*theSrcRow = ( int ) floor(( mSrcExtent.yMaximum() - y ) / mSrcYRes );
362376
*theSrcCol = ( int ) floor(( x - mSrcExtent.xMinimum() ) / mSrcXRes );
363-
//QgsDebugMsg( QString( "mSrcExtent.yMaximum() = %1 mSrcYRes = %2" ).arg(mSrcExtent.yMaximum()).arg(mSrcYRes) );
364-
//QgsDebugMsg( QString( "theSrcRow = %1 theSrcCol = %2" ).arg(*theSrcRow).arg(*theSrcCol) );
377+
#ifdef QGISDEBUG
378+
QgsDebugMsgLevel( QString( "mSrcExtent.yMaximum() = %1 mSrcYRes = %2" ).arg( mSrcExtent.yMaximum() ).arg( mSrcYRes ), 5 );
379+
QgsDebugMsgLevel( QString( "theSrcRow = %1 theSrcCol = %2" ).arg( *theSrcRow ).arg( *theSrcCol ), 5 );
380+
#endif
365381

366382
// With epsg 32661 (Polar Stereographic) it was happening that *theSrcCol == mSrcCols
367383
// For now silently correct limits to avoid crashes
@@ -555,10 +571,10 @@ void * QgsRasterProjector::readBlock( int bandNo, QgsRectangle const & extent,
555571
QgsDebugMsg( "Entered" );
556572
if ( !mInput ) return 0;
557573

558-
int bandNumber = 1;
559574
if ( ! mSrcCRS.isValid() || ! mDestCRS.isValid() || mSrcCRS == mDestCRS )
560575
{
561-
return mInput->block( bandNumber, extent, width, height );
576+
QgsDebugMsg( "No projection necessary" );
577+
return mInput->block( bandNo, extent, width, height );
562578
}
563579

564580
mDestExtent = extent;
@@ -575,7 +591,7 @@ void * QgsRasterProjector::readBlock( int bandNo, QgsRectangle const & extent,
575591
return 0;
576592
}
577593

578-
void * inputData = mInput->block( bandNumber, srcExtent(), srcCols(), srcRows() );
594+
void * inputData = mInput->block( bandNo, srcExtent(), srcCols(), srcRows() );
579595

580596
if ( !inputData ) return 0;
581597

‎src/core/qgsrasterprojector.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,17 @@
2626
#include <QVector>
2727
#include <QList>
2828

29-
3029
#include "qgsrectangle.h"
3130
#include "qgscoordinatereferencesystem.h"
3231
#include "qgscoordinatetransform.h"
3332
#include "qgsrasterinterface.h"
3433

3534
#include <cmath>
3635

37-
//class QgsRectangle;
3836
class QgsPoint;
3937

40-
//class CORE_EXPORT QgsRasterProjector
41-
class QgsRasterProjector : public QgsRasterInterface
38+
class CORE_EXPORT QgsRasterProjector : public QgsRasterInterface
4239
{
43-
// Q_OBJECT
4440
public:
4541
/** \brief QgsRasterProjector implements approximate projection support for
4642
* it calculates grid of points in source CRS for target CRS + extent
@@ -126,7 +122,6 @@ class QgsRasterProjector : public QgsRasterInterface
126122
bool checkRows();
127123

128124
/** Calculate array of src helper points */
129-
//void calcHelper ( int theMatrixRow, QList<QgsPoint> *thePoints );
130125
void calcHelper( int theMatrixRow, QgsPoint *thePoints );
131126

132127
/** Calc / switch helper */

‎src/core/raster/qgsmultibandcolorrenderer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class CORE_EXPORT QgsMultiBandColorRenderer: public QgsRasterRenderer
3434

3535
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
3636

37-
//void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
3837
void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height );
3938

4039
int redBand() const { return mRedBand; }

‎src/core/raster/qgsrasterinterface.cpp

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@
1515
* *
1616
***************************************************************************/
1717

18-
#include "qgsrasterinterface.h"
19-
#include "qgslogger.h"
20-
2118
#include <QByteArray>
2219
#include <QTime>
2320

21+
#include "qgslogger.h"
22+
#include "qgsrasterinterface.h"
23+
2424
QgsRasterInterface::QgsRasterInterface( QgsRasterInterface * input, Role role )
25-
: mInput( input )
26-
, mRole( role )
27-
, mTimeMinSize(150)
25+
: mInput( input )
26+
, mRole( role )
27+
, mTimeMinSize( 150 )
2828
{
2929
}
3030

@@ -54,20 +54,21 @@ void * QgsRasterInterface::block( int bandNo, QgsRectangle const & extent, int
5454

5555
if ( width > mTimeMinSize && height > mTimeMinSize )
5656
{
57-
if ( mTime.size() <= bandNo )
57+
if ( mTime.size() <= bandNo )
5858
{
59-
mTime.resize( bandNo+1 );
59+
mTime.resize( bandNo + 1 );
6060
}
61+
// QTime counts only in miliseconds
6162
mTime[bandNo] = time.elapsed();
62-
QgsDebugMsg ( QString("mRole = %1 bandNo = %2 time = %3" ).arg(mRole).arg(bandNo).arg(mTime[bandNo]) );
63+
QgsDebugMsg( QString( "mRole = %1 bandNo = %2 time = %3" ).arg( mRole ).arg( bandNo ).arg( mTime[bandNo] ) );
6364
}
6465
return b;
6566
}
6667

67-
double QgsRasterInterface::time( int bandNo )
68-
{
68+
double QgsRasterInterface::time( int bandNo )
69+
{
6970
double t = 0;
70-
if ( bandNo == 0 )
71+
if ( bandNo == 0 )
7172
{
7273
for ( int i = 1; i < mTime.size(); i++ )
7374
{
@@ -76,13 +77,13 @@ double QgsRasterInterface::time( int bandNo )
7677
}
7778
else
7879
{
79-
t = mTime.value( bandNo );
80+
t = mTime.value( bandNo );
8081
}
81-
QgsDebugMsg ( QString("mRole = %1 bandNo = %2 time = %3" ).arg(mRole).arg(bandNo).arg(t) );
82+
QgsDebugMsg( QString( "mRole = %1 bandNo = %2 time = %3" ).arg( mRole ).arg( bandNo ).arg( t ) );
8283
return t;
8384
}
8485

85-
double QgsRasterInterface::avgTime( )
86+
double QgsRasterInterface::avgTime( )
8687
{
8788
// Not perfect because Qtime measures ms only and we dont count rendered bands
8889
double t = 0;
@@ -92,5 +93,5 @@ double QgsRasterInterface::avgTime( )
9293
t += mTime[i];
9394
if ( mTime[i] > 0 ) count++;
9495
}
95-
return count > 0 ? t/count : 0;
96+
return count > 0 ? t / count : 0;
9697
}

‎src/core/raster/qgsrasterinterface.h

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,21 @@
1818
#ifndef QGSRASTERINTERFACE_H
1919
#define QGSRASTERINTERFACE_H
2020

21-
#include <QObject>
2221
#include <QImage>
2322

2423
#include "qgsrectangle.h"
2524

2625
/** \ingroup core
2726
* Base class for processing modules.
2827
*/
29-
// TODO: inherit from QObject? QgsDataProvider inherits already from QObject, multiple inheritance from QObject is not allowed
30-
class CORE_EXPORT QgsRasterInterface //: public QObject
28+
// TODO: inherit from QObject? It would be probably better but QgsDataProvider inherits already from QObject and multiple inheritance from QObject is not allowed
29+
class CORE_EXPORT QgsRasterInterface
3130
{
32-
33-
//Q_OBJECT
34-
3531
public:
3632

33+
/** Role is used to identify certain type of interface in pipe and replace
34+
* it with another of the same Role for example
35+
*/
3736
enum Role
3837
{
3938
UnknownRole = 0,
@@ -43,9 +42,9 @@ class CORE_EXPORT QgsRasterInterface //: public QObject
4342
ProjectorRole = 4
4443
};
4544

46-
Role role() { return mRole; }
47-
48-
// This is modified copy of GDALDataType
45+
/** Data types.
46+
* This is modified and extended copy of GDALDataType.
47+
*/
4948
enum DataType
5049
{
5150
/*! Unknown or unspecified type */ UnknownDataType = 0,
@@ -68,9 +67,16 @@ class CORE_EXPORT QgsRasterInterface //: public QObject
6867
TypeCount = 14 /* maximum type # + 1 */
6968
};
7069

70+
QgsRasterInterface( QgsRasterInterface * input = 0, Role role = UnknownRole );
71+
72+
virtual ~QgsRasterInterface();
73+
74+
/** Interface role */
75+
Role role() { return mRole; }
76+
7177
int typeSize( int dataType ) const
7278
{
73-
// modified copy from GDAL
79+
// Modified and extended copy from GDAL
7480
switch ( dataType )
7581
{
7682
case Byte:
@@ -102,15 +108,12 @@ class CORE_EXPORT QgsRasterInterface //: public QObject
102108
return 0;
103109
}
104110
}
111+
105112
int dataTypeSize( int bandNo ) const
106113
{
107114
return typeSize( dataType( bandNo ) );
108115
}
109116

110-
QgsRasterInterface( QgsRasterInterface * input = 0, Role role = UnknownRole );
111-
112-
virtual ~QgsRasterInterface();
113-
114117
/** Returns data type for the band specified by number */
115118
virtual int dataType( int bandNo ) const
116119
{
@@ -124,7 +127,7 @@ class CORE_EXPORT QgsRasterInterface //: public QObject
124127
return 1;
125128
}
126129

127-
// TODO
130+
/** Retruns value representing 'no data' (NULL) */
128131
virtual double noDataValue() const { return 0; }
129132

130133
/** Read block of data using given extent and size.
@@ -133,7 +136,7 @@ class CORE_EXPORT QgsRasterInterface //: public QObject
133136
*/
134137
void * block( int bandNo, QgsRectangle const & extent, int width, int height );
135138

136-
/** Read block of data using given extent and size.
139+
/** Read block of data using given extent and size.
137140
* Method to be implemented by subclasses.
138141
* Returns pointer to data.
139142
* Caller is responsible to free the memory returned.
@@ -148,30 +151,40 @@ class CORE_EXPORT QgsRasterInterface //: public QObject
148151
* Returns true if set correctly, false if cannot use that input */
149152
virtual bool setInput( QgsRasterInterface* input ) { mInput = input; return true; }
150153

154+
/** Get source / raw input, the first in pipe, usually provider.
155+
* It may be used to get info about original data, e.g. resolution to decide
156+
* resampling etc.
157+
*/
158+
virtual QgsRasterInterface * srcInput() { return mInput ? mInput->srcInput() : 0; }
159+
151160
/** Create a new image with extraneous data, such data may be used
152161
* after the image is destroyed. The memory is not initialized.
153162
*/
154163
QImage * createImage( int width, int height, QImage::Format format );
155164

156-
// Clear last rendering time
165+
/** Clear last rendering time */
157166
void clearTime() { mTime.clear(); if ( mInput ) mInput->clearTime(); }
158-
159-
// Last time consumed by block()
160-
// Returns total time (for all bands) if bandNo is 0
167+
168+
/** Last time consumed by call to block()
169+
* Returns total time (for all bands) if bandNo is 0
170+
*/
161171
double time( int bandNo );
162-
double avgTime();
163172

164-
//protected:
173+
/** Average time for all bands consumed by last calls to block() */
174+
double avgTime();
165175

176+
protected:
177+
// Role of interface
166178
Role mRole;
167179

168-
// QgsRasterInterface from used as input, data are read from it
180+
// QgsRasterInterface used as input
169181
QgsRasterInterface* mInput;
170182

171-
// Last rendering time
183+
private:
184+
// Last rendering times, from index 1
172185
QVector<double> mTime;
173186

174-
// minimum block size to record time (to ignore thumbnails etc)
187+
// Minimum block size to record time (to ignore thumbnails etc)
175188
int mTimeMinSize;
176189
};
177190

‎src/core/raster/qgsrasterrenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
QgsRasterRenderer::QgsRasterRenderer( QgsRasterInterface* input, const QString& type )
3535
: QgsRasterInterface( input, QgsRasterInterface::RendererRole ),
36-
mType( type ), mZoomedInResampler( 0 ), mZoomedOutResampler( 0 ), mOpacity( 1.0 ), mRasterTransparency( 0 ),
36+
mType( type ), mOpacity( 1.0 ), mRasterTransparency( 0 ),
3737
mAlphaBand( -1 ), mInvertColor( false ), mMaxOversampling( 2.0 )
3838
{
3939
}

‎src/core/raster/qgsrasterrenderer.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
3838
virtual ~QgsRasterRenderer();
3939

4040
virtual QString type() const { return mType; }
41-
//virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel ) = 0;
4241

4342
virtual void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height )
4443
{
@@ -74,14 +73,7 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
7473
/**Write upper class info into rasterrenderer element (called by writeXML method of subclasses)*/
7574
void _writeXML( QDomDocument& doc, QDomElement& rasterRendererElem ) const;
7675

77-
78-
QgsRasterInterface* mProvider;
7976
QString mType;
80-
/**Resampler used if screen resolution is higher than raster resolution (zoomed in). 0 means no resampling (nearest neighbour)*/
81-
QgsRasterResampler* mZoomedInResampler;
82-
/**Resampler used if raster resolution is higher than raster resolution (zoomed out). 0 mean no resampling (nearest neighbour)*/
83-
QgsRasterResampler* mZoomedOutResampler;
84-
//QMap<int, RasterPartInfo> mRasterPartInfos;
8577

8678
/**Global alpha value (0-1)*/
8779
double mOpacity;
@@ -95,11 +87,6 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
9587

9688
/**Maximum boundary for oversampling (to avoid too much data traffic). Default: 2.0*/
9789
double mMaxOversampling;
98-
99-
private:
100-
/**Remove part into and release memory*/
101-
void removePartInfo( int bandNumer );
102-
void projectImage( const QImage& srcImg, QImage& dstImage, QgsRasterProjector* prj ) const;
10390
};
10491

10592
inline double QgsRasterRenderer::readValue( void *data, QgsRasterInterface::DataType type, int index )
@@ -111,9 +98,7 @@ inline double QgsRasterRenderer::readValue( void *data, QgsRasterInterface::Data
11198

11299
if ( !data )
113100
{
114-
// TODO
115-
//return mInput->noDataValue();
116-
return 0;
101+
return mInput->noDataValue();
117102
}
118103

119104
switch ( type )

‎src/core/raster/qgsrasterresamplefilter.cpp

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* *
1616
***************************************************************************/
1717

18+
#include "qgsrasterdataprovider.h"
1819
#include "qgsrasterresamplefilter.h"
1920
#include "qgsrasterresampler.h"
2021
#include "qgsrasterprojector.h"
@@ -40,21 +41,19 @@ QgsRasterResampleFilter::QgsRasterResampleFilter( QgsRasterInterface* input )
4041

4142
QgsRasterResampleFilter::~QgsRasterResampleFilter()
4243
{
43-
// TODO: currently we are using pointer to renderer, enable once moved here
44-
//delete mZoomedInResampler;
45-
//delete mZoomedOutResampler;
46-
//delete mRasterTransparency;
44+
delete mZoomedInResampler;
45+
delete mZoomedOutResampler;
4746
}
4847

4948
void QgsRasterResampleFilter::setZoomedInResampler( QgsRasterResampler* r )
5049
{
51-
//delete mZoomedInResampler;
50+
delete mZoomedInResampler;
5251
mZoomedInResampler = r;
5352
}
5453

5554
void QgsRasterResampleFilter::setZoomedOutResampler( QgsRasterResampler* r )
5655
{
57-
//delete mZoomedOutResampler;
56+
delete mZoomedOutResampler;
5857
mZoomedOutResampler = r;
5958
}
6059

@@ -67,18 +66,16 @@ void * QgsRasterResampleFilter::readBlock( int bandNo, QgsRectangle const & ext
6766

6867
if ( mZoomedInResampler || mZoomedOutResampler )
6968
{
70-
// TODO: we must get it somehow from pipe (via projector), for now
71-
oversampling = 2.;
72-
/*
73-
QgsRectangle providerExtent = mInput->extent();
74-
if ( viewPort->mSrcCRS.isValid() && viewPort->mDestCRS.isValid() && viewPort->mSrcCRS != viewPort->mDestCRS )
69+
QgsRasterDataProvider *provider = dynamic_cast<QgsRasterDataProvider*>( mInput->srcInput() );
70+
// Do not oversample if data source does not have fixed resolution (WMS)
71+
if ( provider && ( provider->capabilities() & QgsRasterDataProvider::Size ) )
7572
{
76-
QgsCoordinateTransform t( viewPort->mSrcCRS, viewPort->mDestCRS );
77-
providerExtent = t.transformBoundingBox( providerExtent );
73+
double xRes = extent.width() / width;
74+
double providerXRes = provider->extent().width() / provider->xSize();
75+
double pixelRatio = xRes / providerXRes;
76+
oversampling = ( pixelRatio > mMaxOversampling ) ? mMaxOversampling : pixelRatio;
77+
QgsDebugMsg( QString( "xRes = %1 providerXRes = %2 pixelRatio = %3 oversampling = %4" ).arg( xRes ).arg( providerXRes ).arg( pixelRatio ).arg( oversampling ) );
7878
}
79-
double pixelRatio = mapToPixel->mapUnitsPerPixel() / ( providerExtent.width() / mInput->xSize() );
80-
oversampling = ( pixelRatio > mMaxOversampling ) ? mMaxOversampling : pixelRatio;
81-
*/
8279
}
8380

8481
//set oversampling back to 1.0 if no resampler for zoomed in / zoomed out (nearest neighbour)

‎src/core/raster/qgsrasterresamplefilter.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,7 @@
2121
#include "qgsrasterdataprovider.h"
2222
#include "qgsrasterinterface.h"
2323

24-
class QPainter;
25-
class QgsMapToPixel;
2624
class QgsRasterResampler;
27-
class QgsRasterProjector;
28-
class QgsRasterTransparency;
29-
class QgsRasterViewPort;
3025

3126
class QDomElement;
3227

@@ -55,16 +50,10 @@ class QgsRasterResampleFilter : public QgsRasterInterface
5550
void readXML( const QDomElement& resamplefilterElem );
5651

5752
protected:
58-
59-
/**Write upper class info into <rasterresamplefilter> element (called by writeXML method of subclasses)*/
60-
//void _writeXML( QDomDocument& doc, QDomElement& rasterRendererElem ) const;
61-
62-
6353
/**Resampler used if screen resolution is higher than raster resolution (zoomed in). 0 means no resampling (nearest neighbour)*/
6454
QgsRasterResampler* mZoomedInResampler;
6555
/**Resampler used if raster resolution is higher than raster resolution (zoomed out). 0 mean no resampling (nearest neighbour)*/
6656
QgsRasterResampler* mZoomedOutResampler;
67-
//QMap<int, RasterPartInfo> mRasterPartInfos;
6857

6958
/**Maximum boundary for oversampling (to avoid too much data traffic). Default: 2.0*/
7059
double mMaxOversampling;

‎src/core/raster/qgssinglebandcolordatarenderer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class CORE_EXPORT QgsSingleBandColorDataRenderer: public QgsRasterRenderer
3030

3131
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
3232

33-
//virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
34-
3533
void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height );
3634

3735
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

‎src/core/raster/qgssinglebandgrayrenderer.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,8 @@ class CORE_EXPORT QgsSingleBandGrayRenderer: public QgsRasterRenderer
2929
QgsSingleBandGrayRenderer( QgsRasterInterface* input, int grayBand );
3030
~QgsSingleBandGrayRenderer();
3131

32-
//static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider );
3332
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
3433

35-
//virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
36-
3734
void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height );
3835

3936
int grayBand() const { return mGrayBand; }

‎src/core/raster/qgssinglebandpseudocolorrenderer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class CORE_EXPORT QgsSingleBandPseudoColorRenderer: public QgsRasterRenderer
3232

3333
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input );
3434

35-
//virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
36-
3735
void * readBlock( int bandNo, QgsRectangle const & extent, int width, int height );
3836

3937
/**Takes ownership of the shader*/

0 commit comments

Comments
 (0)
Please sign in to comment.