QGIS API Documentation
3.2.0-Bonn (bc43194)
|
Iterator for sequentially processing raster cells. More...
#include <qgsrasteriterator.h>
Public Member Functions | |
QgsRasterIterator (QgsRasterInterface *input) | |
Constructor for QgsRasterIterator, iterating over the specified input raster source. More... | |
const QgsRasterInterface * | input () const |
Returns the input raster interface which is being iterated over. More... | |
int | maximumTileHeight () const |
Returns the minimum tile width returned during iteration. More... | |
int | maximumTileWidth () const |
Returns the maximum tile width returned during iteration. More... | |
bool | readNextRasterPart (int bandNumber, int &nCols, int &nRows, QgsRasterBlock **block, int &topLeftCol, int &topLeftRow) |
Fetches next part of raster data, caller takes ownership of the block and caller should delete the block. More... | |
bool | readNextRasterPart (int bandNumber, int &nCols, int &nRows, std::unique_ptr< QgsRasterBlock > &block, int &topLeftCol, int &topLeftRow, QgsRectangle *blockExtent=nullptr) SIP_SKIP |
Fetches next part of raster data. More... | |
void | setMaximumTileHeight (int h) |
Sets the minimum tile height returned during iteration. More... | |
void | setMaximumTileWidth (int w) |
Sets the maximum tile width returned during iteration. More... | |
void | startRasterRead (int bandNumber, int nCols, int nRows, const QgsRectangle &extent, QgsRasterBlockFeedback *feedback=nullptr) |
Start reading of raster band. More... | |
void | stopRasterRead (int bandNumber) |
Cancels the raster iteration and resets the iterator. More... | |
Static Public Attributes | |
static const int | DEFAULT_MAXIMUM_TILE_HEIGHT = 2000 |
Default maximum tile height. More... | |
static const int | DEFAULT_MAXIMUM_TILE_WIDTH = 2000 |
Default maximum tile width. More... | |
Iterator for sequentially processing raster cells.
Definition at line 33 of file qgsrasteriterator.h.
QgsRasterIterator::QgsRasterIterator | ( | QgsRasterInterface * | input | ) |
Constructor for QgsRasterIterator, iterating over the specified input raster source.
Definition at line 21 of file qgsrasteriterator.cpp.
|
inline |
Returns the input raster interface which is being iterated over.
Definition at line 95 of file qgsrasteriterator.h.
|
inline |
Returns the minimum tile width returned during iteration.
Definition at line 123 of file qgsrasteriterator.h.
|
inline |
Returns the maximum tile width returned during iteration.
Definition at line 109 of file qgsrasteriterator.h.
bool QgsRasterIterator::readNextRasterPart | ( | int | bandNumber, |
int & | nCols, | ||
int & | nRows, | ||
QgsRasterBlock ** | block, | ||
int & | topLeftCol, | ||
int & | topLeftRow | ||
) |
Fetches next part of raster data, caller takes ownership of the block and caller should delete the block.
bandNumber | band to read |
nCols | number of columns on output device |
nRows | number of rows on output device |
block | address of block pointer |
topLeftCol | top left column |
topLeftRow | top left row |
Definition at line 60 of file qgsrasteriterator.cpp.
bool QgsRasterIterator::readNextRasterPart | ( | int | bandNumber, |
int & | nCols, | ||
int & | nRows, | ||
std::unique_ptr< QgsRasterBlock > & | block, | ||
int & | topLeftCol, | ||
int & | topLeftRow, | ||
QgsRectangle * | blockExtent = nullptr |
||
) |
Fetches next part of raster data.
bandNumber | band to read |
nCols | number of columns on output device |
nRows | number of rows on output device |
block | address of block pointer |
topLeftCol | top left column |
topLeftRow | top left row |
blockExtent | optional storage for exact extent of returned raster block |
Definition at line 73 of file qgsrasteriterator.cpp.
|
inline |
Sets the minimum tile height returned during iteration.
Definition at line 116 of file qgsrasteriterator.h.
|
inline |
Sets the maximum tile width returned during iteration.
Definition at line 102 of file qgsrasteriterator.h.
void QgsRasterIterator::startRasterRead | ( | int | bandNumber, |
int | nCols, | ||
int | nRows, | ||
const QgsRectangle & | extent, | ||
QgsRasterBlockFeedback * | feedback = nullptr |
||
) |
Start reading of raster band.
Raster data can then be retrieved by calling readNextRasterPart until it returns false.
bandNumber | number of raster band to read |
nCols | number of columns |
nRows | number of rows |
extent | area to read |
feedback | optional raster feedback object for cancelation/preview. Added in QGIS 3.0. |
Definition at line 38 of file qgsrasteriterator.cpp.
void QgsRasterIterator::stopRasterRead | ( | int | bandNumber | ) |
Cancels the raster iteration and resets the iterator.
Definition at line 136 of file qgsrasteriterator.cpp.
|
static |
Default maximum tile height.
Definition at line 129 of file qgsrasteriterator.h.
|
static |
Default maximum tile width.
Definition at line 126 of file qgsrasteriterator.h.