Skip to content

Commit b69ff58

Browse files
committed
sip modified for raster pipes
1 parent 82f6739 commit b69ff58

5 files changed

Lines changed: 41 additions & 21 deletions

File tree

‎python/core/qgsrasterrenderer.sip‎

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class QgsRasterRenderer
2929
virtual ~QgsRasterRenderer();
3030

3131
virtual QString type() const;
32-
virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel ) = 0;
32+
virtual void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );
3333

3434
bool usesTransparency( QgsCoordinateReferenceSystem& srcSRS, QgsCoordinateReferenceSystem& dstSRS ) const;
3535

@@ -45,17 +45,6 @@ class QgsRasterRenderer
4545
void setInvertColor( bool invert );
4646
bool invertColor() const;
4747

48-
/**Set resampler for zoomed in scales. Takes ownership of the object*/
49-
void setZoomedInResampler( QgsRasterResampler* r );
50-
const QgsRasterResampler* zoomedInResampler();
51-
52-
/**Set resampler for zoomed out scales. Takes ownership of the object*/
53-
void setZoomedOutResampler( QgsRasterResampler* r );
54-
const QgsRasterResampler* zoomedOutResampler() const;
55-
56-
void setMaxOversampling( double os );
57-
double maxOversampling() const;
58-
5948
/**Get symbology items if provided by renderer*/
6049
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
6150

@@ -76,7 +65,7 @@ class QgsPalettedRasterRenderer: QgsRasterRenderer
7665
~QgsPalettedRasterRenderer();
7766
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider );
7867

79-
void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
68+
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );
8069

8170
/**Returns number of colors*/
8271
int nColors() const;
@@ -101,7 +90,7 @@ class QgsMultiBandColorRenderer: QgsRasterRenderer
10190

10291
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider );
10392

104-
void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
93+
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );
10594

10695
int redBand() const;
10796
void setRedBand( int band );
@@ -137,7 +126,7 @@ class QgsSingleBandPseudoColorRenderer: QgsRasterRenderer
137126

138127
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider );
139128

140-
virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
129+
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );
141130

142131
/**Takes ownership of the shader*/
143132
void setShader( QgsRasterShader* shader );
@@ -159,7 +148,7 @@ class QgsSingleBandGrayRenderer: QgsRasterRenderer
159148

160149
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider );
161150

162-
virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
151+
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );
163152

164153
int grayBand() const;
165154
void setGrayBand( int band );
@@ -183,7 +172,7 @@ class QgsSingleBandColorDataRenderer: QgsRasterRenderer
183172

184173
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider );
185174

186-
virtual void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );
175+
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );
187176

188177
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;
189178
};
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
class QgsRasterResampleFilter
2+
{
3+
%TypeHeaderCode
4+
#include "qgsrasterresamplefilter.h"
5+
%End
6+
7+
public:
8+
QgsRasterResampleFilter( QgsRasterFace* input = 0 );
9+
~QgsRasterResampleFilter();
10+
11+
void * readBlock( int bandNo, const QgsRectangle & extent, int width, int height );
12+
13+
/**Set resampler for zoomed in scales. Takes ownership of the object*/
14+
void setZoomedInResampler( QgsRasterResampler* r );
15+
const QgsRasterResampler* zoomedInResampler();
16+
17+
/**Set resampler for zoomed out scales. Takes ownership of the object*/
18+
void setZoomedOutResampler( QgsRasterResampler* r );
19+
const QgsRasterResampler* zoomedOutResampler() const;
20+
21+
void setMaxOversampling( double os );
22+
double maxOversampling() const;
23+
24+
virtual void writeXML( QDomDocument& doc, QDomElement& parentElem ) const = 0;
25+
26+
/**Sets base class members from xml. Usually called from create() methods of subclasses*/
27+
void readXML( const QDomElement& rendererElem );
28+
};
29+

‎src/core/raster/qgsmultibandcolorrenderer.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,18 +118,18 @@ void * QgsMultiBandColorRenderer::readBlock( int bandNo, QgsRectangle const & e
118118
&& mAlphaBand < 1 && !mRedContrastEnhancement && !mGreenContrastEnhancement && !mBlueContrastEnhancement
119119
&& !mInvertColor );
120120
*/
121-
QgsRasterDataProvider::DataType redType = QgsRasterDataProvider::UnknownDataType;
121+
QgsRasterFace::DataType redType = QgsRasterFace::UnknownDataType;
122122

123123
if ( mRedBand > 0 )
124124
{
125125
redType = ( QgsRasterFace::DataType )mInput->dataType( mRedBand );
126126
}
127-
QgsRasterDataProvider::DataType greenType = QgsRasterDataProvider::UnknownDataType;
127+
QgsRasterFace::DataType greenType = QgsRasterFace::UnknownDataType;
128128
if ( mGreenBand > 0 )
129129
{
130130
greenType = ( QgsRasterFace::DataType )mInput->dataType( mGreenBand );
131131
}
132-
QgsRasterDataProvider::DataType blueType = QgsRasterDataProvider::UnknownDataType;
132+
QgsRasterFace::DataType blueType = QgsRasterFace::UnknownDataType;
133133
if ( mBlueBand > 0 )
134134
{
135135
blueType = ( QgsRasterFace::DataType )mInput->dataType( mBlueBand );

‎src/core/raster/qgsrasterrenderer.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterFace
6060
void setInvertColor( bool invert ) { mInvertColor = invert; }
6161
bool invertColor() const { return mInvertColor; }
6262

63+
/**Get symbology items if provided by renderer*/
64+
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const { Q_UNUSED( symbolItems ); }
65+
6366
virtual void writeXML( QDomDocument& doc, QDomElement& parentElem ) const = 0;
6467

6568
/**Sets base class members from xml. Usually called from create() methods of subclasses*/

‎src/core/raster/qgssinglebandpseudocolorrenderer.cpp‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ void * QgsSingleBandPseudoColorRenderer::readBlock( int bandNo, QgsRectangle co
7272
transparencyType = ( QgsRasterFace::DataType )mInput->dataType( mAlphaBand );
7373
}
7474

75-
void* transparencyData;
7675
void* transparencyData = 0;
7776
double currentOpacity = mOpacity;
7877
QgsRasterFace::DataType rasterType = ( QgsRasterFace::DataType )mInput->dataType( mBand );

0 commit comments

Comments
 (0)