|
QGIS API Documentation
master-3f58142
|
Resample filter pipe for rasters. More...
#include <qgsrasterresamplefilter.h>
Inheritance diagram for QgsRasterResampleFilter:
Collaboration diagram for QgsRasterResampleFilter:Public Member Functions | |
| QgsRasterResampleFilter (QgsRasterInterface *input=0) | |
| ~QgsRasterResampleFilter () | |
| int | bandCount () const |
| Get number of bands. | |
| QgsRasterBlock * | block (int bandNo, const QgsRectangle &extent, int width, int height) |
| Read block of data using given extent and size. | |
| QgsRasterInterface * | clone () const |
| Clone itself, create deep copy. | |
| QGis::DataType | dataType (int bandNo) const |
| Returns data type for the band specified by number. | |
| double | maxOversampling () const |
| void | readXML (const QDomElement &filterElem) |
| Sets base class members from xml. | |
| bool | setInput (QgsRasterInterface *input) |
| Set input. | |
| void | setMaxOversampling (double os) |
| void | setZoomedInResampler (QgsRasterResampler *r) |
| Set resampler for zoomed in scales. | |
| void | setZoomedOutResampler (QgsRasterResampler *r) |
| Set resampler for zoomed out scales. | |
| void | writeXML (QDomDocument &doc, QDomElement &parentElem) const |
| Write base class members to xml. | |
| const QgsRasterResampler * | zoomedInResampler () const |
| const QgsRasterResampler * | zoomedOutResampler () const |
Protected Attributes | |
| double | mMaxOversampling |
| Maximum boundary for oversampling (to avoid too much data traffic). | |
| QgsRasterResampler * | mZoomedInResampler |
| Resampler used if screen resolution is higher than raster resolution (zoomed in). | |
| QgsRasterResampler * | mZoomedOutResampler |
| Resampler used if raster resolution is higher than raster resolution (zoomed out). | |
Resample filter pipe for rasters.
Definition at line 31 of file qgsrasterresamplefilter.h.
Definition at line 35 of file qgsrasterresamplefilter.cpp.
Referenced by clone().
Definition at line 42 of file qgsrasterresamplefilter.cpp.
References mZoomedInResampler, and mZoomedOutResampler.
| int QgsRasterResampleFilter::bandCount | ( | ) | const [virtual] |
Get number of bands.
Implements QgsRasterInterface.
Definition at line 64 of file qgsrasterresamplefilter.cpp.
References QgsRasterInterface::bandCount(), QgsRasterInterface::mInput, and QgsRasterInterface::mOn.
| QgsRasterBlock * QgsRasterResampleFilter::block | ( | int | bandNo, |
| const QgsRectangle & | extent, | ||
| int | width, | ||
| int | height | ||
| ) | [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 |
Implements QgsRasterInterface.
Definition at line 131 of file qgsrasterresamplefilter.cpp.
References QGis::ARGB32_Premultiplied, QgsRasterInterface::block(), QgsRasterInterface::capabilities(), QgsRasterDataProvider::extent(), QgsRasterBlock::image(), QgsRasterBlock::isEmpty(), QgsRasterInterface::mInput, mMaxOversampling, mZoomedInResampler, mZoomedOutResampler, QgsDebugMsg, qgsDoubleNear(), QgsRasterResampler::resample(), QgsRasterBlock::reset(), QgsRasterBlock::setImage(), QgsRasterInterface::Size, QgsRasterInterface::srcInput(), QgsRectangle::toString(), QgsRectangle::width(), and QgsRasterInterface::xSize().
| QgsRasterInterface * QgsRasterResampleFilter::clone | ( | ) | const [virtual] |
Clone itself, create deep copy.
Implements QgsRasterInterface.
Definition at line 48 of file qgsrasterresamplefilter.cpp.
References QgsRasterResampler::clone(), mMaxOversampling, mZoomedInResampler, mZoomedOutResampler, QgsDebugMsg, QgsRasterResampleFilter(), setMaxOversampling(), setZoomedInResampler(), and setZoomedOutResampler().
| QGis::DataType QgsRasterResampleFilter::dataType | ( | int | bandNo | ) | const [virtual] |
Returns data type for the band specified by number.
Implements QgsRasterInterface.
Definition at line 73 of file qgsrasterresamplefilter.cpp.
References QGis::ARGB32_Premultiplied, QgsRasterInterface::dataType(), QgsRasterInterface::mInput, QgsRasterInterface::mOn, and QGis::UnknownDataType.
| double QgsRasterResampleFilter::maxOversampling | ( | ) | const [inline] |
Definition at line 56 of file qgsrasterresamplefilter.h.
| void QgsRasterResampleFilter::readXML | ( | const QDomElement & | filterElem | ) | [virtual] |
Sets base class members from xml.
Usually called from create() methods of subclasses
Reimplemented from QgsRasterInterface.
Definition at line 245 of file qgsrasterresamplefilter.cpp.
References mMaxOversampling, mZoomedInResampler, and mZoomedOutResampler.
Referenced by QgsRasterLayer::readSymbology().
| bool QgsRasterResampleFilter::setInput | ( | QgsRasterInterface * | input | ) | [virtual] |
Set input.
Returns true if set correctly, false if cannot use that input
Reimplemented from QgsRasterInterface.
Definition at line 82 of file qgsrasterresamplefilter.cpp.
References QGis::ARGB32, QGis::ARGB32_Premultiplied, QgsRasterInterface::bandCount(), QgsRasterInterface::dataType(), QgsRasterInterface::input(), QgsRasterInterface::mInput, QgsRasterInterface::mOn, and QgsDebugMsg.
| void QgsRasterResampleFilter::setMaxOversampling | ( | double | os | ) | [inline] |
Definition at line 55 of file qgsrasterresamplefilter.h.
Referenced by clone().
Set resampler for zoomed in scales.
Takes ownership of the object
Definition at line 119 of file qgsrasterresamplefilter.cpp.
References mZoomedInResampler.
Referenced by clone().
Set resampler for zoomed out scales.
Takes ownership of the object
Definition at line 125 of file qgsrasterresamplefilter.cpp.
References mZoomedOutResampler.
Referenced by clone().
| void QgsRasterResampleFilter::writeXML | ( | QDomDocument & | doc, |
| QDomElement & | parentElem | ||
| ) | const [virtual] |
Write base class members to xml.
Reimplemented from QgsRasterInterface.
Definition at line 224 of file qgsrasterresamplefilter.cpp.
References mMaxOversampling, mZoomedInResampler, mZoomedOutResampler, and QgsRasterResampler::type().
| const QgsRasterResampler* QgsRasterResampleFilter::zoomedInResampler | ( | ) | const [inline] |
Definition at line 49 of file qgsrasterresamplefilter.h.
| const QgsRasterResampler* QgsRasterResampleFilter::zoomedOutResampler | ( | ) | const [inline] |
Definition at line 53 of file qgsrasterresamplefilter.h.
double QgsRasterResampleFilter::mMaxOversampling [protected] |
Maximum boundary for oversampling (to avoid too much data traffic).
Default: 2.0
Definition at line 70 of file qgsrasterresamplefilter.h.
Referenced by block(), clone(), readXML(), and writeXML().
Resampler used if screen resolution is higher than raster resolution (zoomed in).
0 means no resampling (nearest neighbour)
Definition at line 65 of file qgsrasterresamplefilter.h.
Referenced by block(), clone(), readXML(), setZoomedInResampler(), writeXML(), and ~QgsRasterResampleFilter().
Resampler used if raster resolution is higher than raster resolution (zoomed out).
0 mean no resampling (nearest neighbour)
Definition at line 67 of file qgsrasterresamplefilter.h.
Referenced by block(), clone(), readXML(), setZoomedOutResampler(), writeXML(), and ~QgsRasterResampleFilter().