1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasteriterator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsRasterIterator
{
%Docstring(signature="appended")
Iterator for sequentially processing raster cells.
%End
%TypeHeaderCode
#include "qgsrasteriterator.h"
%End
public:
QgsRasterIterator( QgsRasterInterface *input, int tileOverlapPixels = 0 );
%Docstring
Constructor for QgsRasterIterator, iterating over the specified
``input`` raster source.
Since QGIS 3.34 the tileOverlapPixels can be used to specify a margin in
pixels for retrieving pixels overlapping into neighbor cells.
%End
static QgsRectangle subRegion( const QgsRectangle &rasterExtent, int rasterWidth, int rasterHeight, const QgsRectangle &subRegion, int &subRegionWidth /Out/, int &subRegionHeight /Out/, int &subRegionLeft /Out/, int &subRegionTop /Out/ );
%Docstring
Given an overall raster extent and width and height in pixels,
calculates the sub region of the raster covering the specified
``subRegion``.
:param rasterExtent: overall raster extent
:param rasterWidth: overall raster width
:param rasterHeight: overall raster height
:param subRegion: desired sub region extent
:return: - sub region geographic extent, snapped to exact pixel
boundaries
- subRegionWidth: width in pixels of sub region
- subRegionHeight: height in pixels of sub region
- subRegionLeft: starting column of left side of sub region
- subRegionTop: starting row of top side of sub region
.. versionadded:: 3.26
%End
void startRasterRead( int bandNumber, qgssize nCols, qgssize nRows, const QgsRectangle &extent, QgsRasterBlockFeedback *feedback = 0 );
%Docstring
Start reading of raster band. Raster data can then be retrieved by
calling readNextRasterPart until it returns ``False``.
:param bandNumber: number of raster band to read
:param nCols: number of columns
:param nRows: number of rows
:param extent: area to read
:param feedback: optional raster feedback object for
cancellation/preview. Added in QGIS 3.0.
%End
bool next( int bandNumber, int &columns /Out/, int &rows /Out/, int &topLeftColumn /Out/, int &topLeftRow /Out/, QgsRectangle &blockExtent /Out/ );
%Docstring
Fetches details of the next part of the raster data. This method does
NOT actually fetch the raster data itself, rather it calculates and
iterates over the details of the raster alone.
It's useful for iterating over several layers using a target "reference"
layer. E.g. summing the pixels in n rasters whilst aligning the result
to a reference layer which is not being summed.
Note that calling this method also advances the iterator, just like
calling :py:func:`~QgsRasterIterator.readNextRasterPart`.
:param bandNumber: band to read
:return: - ``False`` if the last part was already returned
- columns: number of columns on output device
- rows: number of rows on output device
- topLeftColumn: top left column
- topLeftRow: top left row
- blockExtent: exact extent of returned raster block
.. versionadded:: 3.6
%End
bool readNextRasterPart( int bandNumber,
int &nCols, int &nRows,
QgsRasterBlock **block /TransferBack/,
int &topLeftCol, int &topLeftRow );
%Docstring
Fetches next part of raster data, caller takes ownership of the block
and caller should delete the block.
:param bandNumber: band to read
:param nCols: number of columns on output device
:param nRows: number of rows on output device
:param block: address of block pointer
:param topLeftCol: top left column
:param topLeftRow: top left row
:return: ``False`` if the last part was already returned
%End
void stopRasterRead( int bandNumber );
%Docstring
Cancels the raster iteration and resets the iterator.
%End
const QgsRasterInterface *input() const;
%Docstring
Returns the input raster interface which is being iterated over.
%End
void setMaximumTileWidth( int w );
%Docstring
Sets the maximum tile width returned during iteration.
.. seealso:: :py:func:`maximumTileWidth`
.. seealso:: :py:func:`setMaximumTileHeight`
%End
int maximumTileWidth() const;
%Docstring
Returns the maximum tile width returned during iteration.
.. seealso:: :py:func:`setMaximumTileWidth`
.. seealso:: :py:func:`maximumTileHeight`
%End
void setMaximumTileHeight( int h );
%Docstring
Sets the minimum tile height returned during iteration.
.. seealso:: :py:func:`maximumTileHeight`
.. seealso:: :py:func:`setMaximumTileWidth`
%End
int maximumTileHeight() const;
%Docstring
Returns the minimum tile width returned during iteration.
.. seealso:: :py:func:`setMaximumTileHeight`
.. seealso:: :py:func:`maximumTileWidth`
%End
static const int DEFAULT_MAXIMUM_TILE_WIDTH;
static const int DEFAULT_MAXIMUM_TILE_HEIGHT;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasteriterator.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|