Skip to content

Commit

Permalink
fix QgsPalettedRasterRenderer sip binding
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Mar 11, 2013
1 parent ae42a90 commit 558dcf2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion python/core/core.sip
Expand Up @@ -158,7 +158,7 @@
%Include raster/qgssinglebandcolordatarenderer.sip
%Include raster/qgssinglebandpseudocolorrenderer.sip
%Include raster/qgssinglebandgrayrenderer.sip
%Include raster/qgspaletterasterrenderer.sip
%Include raster/qgspalettedrasterrenderer.sip
%Include raster/qgscubicrasterresampler.sip
%Include raster/qgsmultibandcolorrenderer.sip

Expand Down
@@ -1,16 +1,18 @@
class QgsPalettedRasterRenderer: QgsRasterRenderer
class QgsPalettedRasterRenderer : QgsRasterRenderer
{
%TypeHeaderCode
#include "qgspalettedrasterrenderer.h"
%End
public:
/**Renderer owns color array*/
QgsPalettedRasterRenderer( QgsRasterDataProvider* provider, int bandNumber, QColor* colorArray /Array,Transfer/, int nColors /ArraySize/ );
QgsPalettedRasterRenderer( QgsRasterInterface* input, int bandNumber, QColor* colorArray /Array,Transfer/, int nColors /ArraySize/ );
~QgsPalettedRasterRenderer();
QgsRasterInterface * clone() /Factory/;
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterDataProvider* provider ) /Factory/;
QgsRasterInterface * clone() const /Factory/;
static QgsRasterRenderer* create( const QDomElement& elem, QgsRasterInterface* input ) /Factory/;

QgsRasterBlock * block( int bandNo, const QgsRectangle & extent, int width, int height ) / Factory /;
// void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );

QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height ) /Factory/;

/**Returns number of colors*/
int nColors() const;
Expand All @@ -20,4 +22,6 @@ class QgsPalettedRasterRenderer: QgsRasterRenderer
void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
};

QList<int> usesBands() const;
};
7 changes: 5 additions & 2 deletions src/core/raster/qgspalettedrasterrenderer.h
Expand Up @@ -38,13 +38,16 @@ class CORE_EXPORT QgsPalettedRasterRenderer: public QgsRasterRenderer

void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );

QgsRasterBlock * block( int bandNo, QgsRectangle const & extent, int width, int height );
QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height );

/**Returns number of colors*/
int nColors() const { return mNColors; }
/**Returns copy of color array (caller takes ownership)*/
QColor* colors() const;
/**Returns copy of rgb array (caller takes ownership)*/

/**Returns copy of rgb array (caller takes ownership)
@note not available in python bindings
*/
QRgb* rgbArray() const;

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

0 comments on commit 558dcf2

Please sign in to comment.