Skip to content
Permalink
Browse files
Implement writeXML method for singleband gray renderer
  • Loading branch information
mhugent committed Mar 29, 2012
1 parent 0bd0c06 commit 19eb9def5328175272c78451ee32c81e4f6696c0
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/core/raster/qgssinglebandgrayrenderer.cpp
@@ -18,6 +18,8 @@
#include "qgssinglebandgrayrenderer.h"
#include "qgscontrastenhancement.h"
#include "qgsrastertransparency.h"
#include <QDomDocument>
#include <QDomElement>
#include <QImage>

QgsSingleBandGrayRenderer::QgsSingleBandGrayRenderer( QgsRasterDataProvider* provider, int grayBand ):
@@ -154,5 +156,20 @@ void QgsSingleBandGrayRenderer::draw( QPainter* p, QgsRasterViewPort* viewPort,

void QgsSingleBandGrayRenderer::writeXML( QDomDocument& doc, QDomElement& parentElem ) const
{
//soon...
if ( parentElem.isNull() )
{
return;
}

QDomElement rasterRendererElem = doc.createElement( "rasterrenderer" );
_writeXML( doc, rasterRendererElem );

rasterRendererElem.setAttribute( "grayBand", mGrayBand );
if ( mContrastEnhancement )
{
QDomElement contrastElem = doc.createElement( "contrastEnhancement" );
mContrastEnhancement->writeXML( doc, contrastElem );
rasterRendererElem.appendChild( contrastElem );
}
parentElem.appendChild( rasterRendererElem );
}

0 comments on commit 19eb9de

Please sign in to comment.