QGIS API Documentation
2.6.0-Brighton
|
Base class for processing filters like renderers, reprojector, resampler etc. More...
#include <qgsrasterinterface.h>
Public Types | |
enum | Capability { NoCapabilities = 0, Size = 1 << 1, Create = 1 << 2, Remove = 1 << 3, BuildPyramids = 1 << 4, Identify = 1 << 5, IdentifyValue = 1 << 6, IdentifyText = 1 << 7, IdentifyHtml = 1 << 8, IdentifyFeature = 1 << 9 } |
If you add to this, please also add to capabilitiesString() More... |
Public Member Functions | |
QgsRasterInterface (QgsRasterInterface *input=0) | |
virtual | ~QgsRasterInterface () |
virtual QgsRasterInterface * | clone () const =0 |
Clone itself, create deep copy. | |
virtual int | capabilities () const |
Returns a bitmask containing the supported capabilities. | |
QString | capabilitiesString () const |
Returns the above in friendly format. | |
virtual QGis::DataType | dataType (int bandNo) const =0 |
Returns data type for the band specified by number. | |
virtual QGis::DataType | srcDataType (int bandNo) const |
Returns source data type for the band specified by number, source data type may be shorter than dataType. | |
virtual QgsRectangle | extent () |
Get the extent of the interface. | |
int | dataTypeSize (int bandNo) |
virtual int | bandCount () const =0 |
Get number of bands. | |
virtual int | xBlockSize () const |
Get block size. | |
virtual int | yBlockSize () const |
virtual int | xSize () const |
Get raster size. | |
virtual int | ySize () const |
virtual QString | generateBandName (int theBandNumber) const |
helper function to create zero padded band names | |
virtual QgsRasterBlock * | block (int bandNo, const QgsRectangle &extent, int width, int height)=0 |
Read block of data using given extent and size. | |
virtual bool | setInput (QgsRasterInterface *input) |
Set input. | |
virtual QgsRasterInterface * | input () const |
Current input. | |
virtual bool | on () const |
Is on/off. | |
virtual void | setOn (bool on) |
Set on/off. | |
virtual const QgsRasterInterface * | srcInput () const |
Get source / raw input, the first in pipe, usually provider. | |
virtual QgsRasterInterface * | srcInput () |
virtual QgsRasterBandStats | bandStatistics (int theBandNo, int theStats=QgsRasterBandStats::All, const QgsRectangle &theExtent=QgsRectangle(), int theSampleSize=0) |
Get band statistics. | |
virtual bool | hasStatistics (int theBandNo, int theStats=QgsRasterBandStats::All, const QgsRectangle &theExtent=QgsRectangle(), int theSampleSize=0) |
Returns true if histogram is available (cached, already calculated). | |
virtual QgsRasterHistogram | histogram (int theBandNo, int theBinCount=0, double theMinimum=std::numeric_limits< double >::quiet_NaN(), double theMaximum=std::numeric_limits< double >::quiet_NaN(), const QgsRectangle &theExtent=QgsRectangle(), int theSampleSize=0, bool theIncludeOutOfRange=false) |
Get histogram. | |
virtual bool | hasHistogram (int theBandNo, int theBinCount, double theMinimum=std::numeric_limits< double >::quiet_NaN(), double theMaximum=std::numeric_limits< double >::quiet_NaN(), const QgsRectangle &theExtent=QgsRectangle(), int theSampleSize=0, bool theIncludeOutOfRange=false) |
Returns true if histogram is available (cached, already calculated), the parameters are the same as in histogram() | |
virtual void | cumulativeCut (int theBandNo, double theLowerCount, double theUpperCount, double &theLowerValue, double &theUpperValue, const QgsRectangle &theExtent=QgsRectangle(), int theSampleSize=0) |
Find values for cumulative pixel count cut. | |
virtual void | writeXML (QDomDocument &doc, QDomElement &parentElem) const |
Write base class members to xml. | |
virtual void | readXML (const QDomElement &filterElem) |
Sets base class members from xml. |
Protected Member Functions | |
void | initHistogram (QgsRasterHistogram &theHistogram, int theBandNo, int theBinCount=0, double theMinimum=std::numeric_limits< double >::quiet_NaN(), double theMaximum=std::numeric_limits< double >::quiet_NaN(), const QgsRectangle &theExtent=QgsRectangle(), int theSampleSize=0, bool theIncludeOutOfRange=false) |
Fill in histogram defaults if not specified. | |
void | initStatistics (QgsRasterBandStats &theStatistics, int theBandNo, int theStats=QgsRasterBandStats::All, const QgsRectangle &theExtent=QgsRectangle(), int theBinCount=0) |
Fill in statistics defaults if not specified. |
Protected Attributes | |
QgsRasterInterface * | mInput |
QList< QgsRasterBandStats > | mStatistics |
List of cached statistics, all bands mixed. | |
QList< QgsRasterHistogram > | mHistograms |
List of cached histograms, all bands mixed. | |
bool | mOn |
Base class for processing filters like renderers, reprojector, resampler etc.
If you add to this, please also add to capabilitiesString()
QgsRasterInterface::QgsRasterInterface | ( | QgsRasterInterface * | input = 0 | ) |
|
virtual |
|
pure virtual |
Get number of bands.
Implemented in QgsRasterProjector, QgsRasterRenderer, QgsHueSaturationFilter, QgsRasterNuller, QgsRasterResampleFilter, and QgsBrightnessContrastFilter.
|
virtual |
Get band statistics.
theBandNo | The band (number). |
theStats | Requested statistics |
theExtent | Extent used to calc statistics, if empty, whole raster extent is used. |
theSampleSize | Approximate number of cells in sample. If 0, all cells (whole raster will be used). If raster does not have exact size (WCS without exact size for example), provider decides size of sample. |
|
pure virtual |
Read block of data using given extent and size.
Returns pointer to data. Caller is responsible to free the memory returned.
bandNo | band number |
extent | extent of block |
width | pixel width of block |
height | pixel height of block |
Implemented in QgsRasterDataProvider, QgsRasterProjector, QgsRasterRenderer, QgsHueSaturationFilter, QgsRasterNuller, QgsRasterResampleFilter, QgsSingleBandGrayRenderer, QgsBrightnessContrastFilter, QgsPalettedRasterRenderer, QgsMultiBandColorRenderer, QgsSingleBandColorDataRenderer, and QgsSingleBandPseudoColorRenderer.
|
inlinevirtual |
Returns a bitmask containing the supported capabilities.
QString QgsRasterInterface::capabilitiesString | ( | ) | const |
Returns the above in friendly format.
|
pure virtual |
Clone itself, create deep copy.
Implemented in QgsRasterProjector, QgsRasterDataProvider, QgsRasterRenderer, QgsHueSaturationFilter, QgsRasterNuller, QgsSingleBandGrayRenderer, QgsPalettedRasterRenderer, QgsRasterResampleFilter, QgsMultiBandColorRenderer, QgsBrightnessContrastFilter, QgsSingleBandPseudoColorRenderer, and QgsSingleBandColorDataRenderer.
|
virtual |
Find values for cumulative pixel count cut.
theBandNo | The band (number). |
theLowerCount | The lower count as fraction of 1, e.g. 0.02 = 2% |
theUpperCount | The upper count as fraction of 1, e.g. 0.98 = 98% |
theLowerValue | Location into which the lower value will be set. |
theUpperValue | Location into which the upper value will be set. |
theExtent | Extent used to calc histogram, if empty, whole raster extent is used. |
theSampleSize | Approximate number of cells in sample. If 0, all cells (whole raster will be used). If raster does not have exact size (WCS without exact size for example), provider decides size of sample. |
|
pure virtual |
Returns data type for the band specified by number.
Implemented in QgsRasterProjector, QgsRasterDataProvider, QgsRasterRenderer, QgsHueSaturationFilter, QgsRasterNuller, QgsRasterResampleFilter, and QgsBrightnessContrastFilter.
|
inline |
|
inlinevirtual |
Get the extent of the interface.
Reimplemented in QgsRasterDataProvider.
|
inlinevirtual |
helper function to create zero padded band names
|
virtual |
Returns true if histogram is available (cached, already calculated), the parameters are the same as in histogram()
|
virtual |
Returns true if histogram is available (cached, already calculated).
* The parameters are the same as in bandStatistics()
|
virtual |
Get histogram.
Histograms are cached in providers.
theBandNo | The band (number). |
theBinCount | Number of bins (intervals,buckets). If 0, the number of bins is decided automaticaly according to data type, raster size etc. |
theMinimum | Minimum value, if NaN, raster minimum value will be used. |
theMaximum | Maximum value, if NaN, raster minimum value will be used. |
theExtent | Extent used to calc histogram, if empty, whole raster extent is used. |
theSampleSize | Approximate number of cells in sample. If 0, all cells (whole raster will be used). If raster does not have exact size (WCS without exact size for example), provider decides size of sample. |
theIncludeOutOfRange | include out of range values |
|
protected |
Fill in histogram defaults if not specified.
|
protected |
Fill in statistics defaults if not specified.
|
inlinevirtual |
Current input.
|
inlinevirtual |
Is on/off.
|
inlinevirtual |
Sets base class members from xml.
Usually called from create() methods of subclasses
Reimplemented in QgsRasterRenderer, QgsHueSaturationFilter, QgsRasterResampleFilter, and QgsBrightnessContrastFilter.
|
inlinevirtual |
Set input.
Returns true if set correctly, false if cannot use that input
Reimplemented in QgsRasterDataProvider, QgsRasterRenderer, QgsHueSaturationFilter, QgsRasterResampleFilter, QgsBrightnessContrastFilter, and QgsSingleBandColorDataRenderer.
|
inlinevirtual |
Set on/off.
|
inlinevirtual |
Returns source data type for the band specified by number, source data type may be shorter than dataType.
Reimplemented in QgsRasterDataProvider.
|
inlinevirtual |
Get source / raw input, the first in pipe, usually provider.
It may be used to get info about original data, e.g. resolution to decide resampling etc.
|
inlinevirtual |
|
inlinevirtual |
Write base class members to xml.
Reimplemented in QgsHueSaturationFilter, QgsMultiBandColorRenderer, QgsPalettedRasterRenderer, QgsRasterResampleFilter, QgsSingleBandGrayRenderer, QgsBrightnessContrastFilter, QgsSingleBandPseudoColorRenderer, and QgsSingleBandColorDataRenderer.
|
inlinevirtual |
Get block size.
|
inlinevirtual |
Get raster size.
|
inlinevirtual |
|
inlinevirtual |
|
protected |
List of cached histograms, all bands mixed.
|
protected |
|
protected |
|
protected |
List of cached statistics, all bands mixed.