QGIS API Documentation  master-59fd5e0
QgsRasterRenderer Class Reference

Raster renderer pipe that applies colors to a raster. More...

#include <qgsrasterrenderer.h>

+ Inheritance diagram for QgsRasterRenderer:
+ Collaboration diagram for QgsRasterRenderer:

List of all members.

Public Types

enum  MinMaxOrigin {
  MinMaxUnknown = 0, MinMaxUser = 1, MinMaxMinMax = 1 << 1, MinMaxCumulativeCut = 1 << 2,
  MinMaxStdDev = 1 << 3, MinMaxFullExtent = 1 << 4, MinMaxSubExtent = 1 << 5, MinMaxEstimated = 1 << 6,
  MinMaxExact = 1 << 7
}

Public Member Functions

 QgsRasterRenderer (QgsRasterInterface *input=0, const QString &type="")
virtual ~QgsRasterRenderer ()
int alphaBand () const
virtual int bandCount () const
 Get number of bands.
virtual QgsRasterBlockblock (int bandNo, const QgsRectangle &extent, int width, int height)=0
 Read block of data using given extent and size.
QgsRasterInterfaceclone () const =0
 Clone itself, create deep copy.
virtual QGis::DataType dataType (int bandNo) const
 Returns data type for the band specified by number.
virtual void legendSymbologyItems (QList< QPair< QString, QColor > > &symbolItems) const
 Get symbology items if provided by renderer.
double opacity () const
const QgsRasterTransparencyrasterTransparency () const
void readXML (const QDomElement &rendererElem)
 Sets base class members from xml.
void setAlphaBand (int band)
virtual bool setInput (QgsRasterInterface *input)
 Set input.
void setOpacity (double opacity)
void setRasterTransparency (QgsRasterTransparency *t)
virtual QString type () const
virtual QList< int > usesBands () const
 Returns a list of band numbers used by the renderer.
bool usesTransparency () const

Static Public Member Functions

static int minMaxOriginFromName (QString theName)
static QString minMaxOriginLabel (int theOrigin)
static QString minMaxOriginName (int theOrigin)

Static Public Attributes

static const QRgb NODATA_COLOR = qRgba( 0, 0, 0, 0 )

Protected Member Functions

void _writeXML (QDomDocument &doc, QDomElement &rasterRendererElem) const
 Write upper class info into rasterrenderer element (called by writeXML method of subclasses)

Protected Attributes

int mAlphaBand
 Read alpha value from band.
double mOpacity
 Global alpha value (0-1)
QgsRasterTransparencymRasterTransparency
 Raster transparency per color or value.
QString mType

Detailed Description

Raster renderer pipe that applies colors to a raster.

Definition at line 34 of file qgsrasterrenderer.h.


Member Enumeration Documentation

Enumerator:
MinMaxUnknown 
MinMaxUser 
MinMaxMinMax 
MinMaxCumulativeCut 
MinMaxStdDev 
MinMaxFullExtent 
MinMaxSubExtent 
MinMaxEstimated 
MinMaxExact 

Definition at line 38 of file qgsrasterrenderer.h.


Constructor & Destructor Documentation

QgsRasterRenderer::QgsRasterRenderer ( QgsRasterInterface input = 0,
const QString &  type = "" 
)

Definition at line 32 of file qgsrasterrenderer.cpp.

Definition at line 39 of file qgsrasterrenderer.cpp.


Member Function Documentation

void QgsRasterRenderer::_writeXML ( QDomDocument &  doc,
QDomElement &  rasterRendererElem 
) const [protected]
int QgsRasterRenderer::alphaBand ( ) const [inline]

Definition at line 80 of file qgsrasterrenderer.h.

int QgsRasterRenderer::bandCount ( ) const [virtual]

Get number of bands.

Implements QgsRasterInterface.

Definition at line 43 of file qgsrasterrenderer.cpp.

References QgsRasterInterface::bandCount(), QgsRasterInterface::mInput, and QgsRasterInterface::mOn.

virtual QgsRasterBlock* QgsRasterRenderer::block ( int  bandNo,
const QgsRectangle extent,
int  width,
int  height 
) [pure virtual]

Read block of data using given extent and size.

Returns pointer to data. Caller is responsible to free the memory returned.

Parameters:
bandNoband number
extentextent of block
widthpixel width of block
heightpixel height of block

Implements QgsRasterInterface.

Implemented in QgsSingleBandGrayRenderer, QgsMultiBandColorRenderer, QgsPalettedRasterRenderer, QgsSingleBandColorDataRenderer, and QgsSingleBandPseudoColorRenderer.

QGis::DataType QgsRasterRenderer::dataType ( int  bandNo) const [virtual]

Returns data type for the band specified by number.

Implements QgsRasterInterface.

Definition at line 52 of file qgsrasterrenderer.cpp.

References QGis::ARGB32_Premultiplied, QgsRasterInterface::dataType(), QgsRasterInterface::mInput, QgsRasterInterface::mOn, QgsDebugMsg, and QGis::UnknownDataType.

virtual void QgsRasterRenderer::legendSymbologyItems ( QList< QPair< QString, QColor > > &  symbolItems) const [inline, virtual]

Get symbology items if provided by renderer.

Reimplemented in QgsSingleBandGrayRenderer, QgsPalettedRasterRenderer, and QgsSingleBandPseudoColorRenderer.

Definition at line 83 of file qgsrasterrenderer.h.

Referenced by QgsRasterLayer::legendSymbologyItems().

double QgsRasterRenderer::opacity ( ) const [inline]

Definition at line 74 of file qgsrasterrenderer.h.

void QgsRasterRenderer::readXML ( const QDomElement &  rendererElem) [virtual]
bool QgsRasterRenderer::setInput ( QgsRasterInterface input) [virtual]

Set input.

Returns true if set correctly, false if cannot use that input

Reimplemented from QgsRasterInterface.

Reimplemented in QgsSingleBandColorDataRenderer.

Definition at line 63 of file qgsrasterrenderer.cpp.

References QgsRasterInterface::bandCount(), QgsRasterInterface::dataType(), QgsRasterInterface::input(), QgsRasterInterface::mInput, QgsRasterInterface::mOn, and QgsRasterBlock::typeIsNumeric().

virtual QString QgsRasterRenderer::type ( ) const [inline, virtual]

Definition at line 65 of file qgsrasterrenderer.h.

Referenced by QgsRasterLayer::setContrastEnhancement().

virtual QList<int> QgsRasterRenderer::usesBands ( ) const [inline, virtual]

Member Data Documentation

QString QgsRasterRenderer::mType [protected]

Definition at line 100 of file qgsrasterrenderer.h.

Referenced by _writeXML(), and readXML().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines