mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-28 00:17:30 -05:00
The improvement allows immediate cancellation of raster rendering in progress. Until now, even when map rendering got cancelled (e.g. by zooming of panning canvas), the GUI got blocked while waiting for raster layers to finish their rendering (only vector layers have had support for cancellation). This should allow for much smoother user experience while browsing maps including rasters. The cancellation is supported currently by WMS/WMTS and WCS providers. GDAL provider may also get support thanks to improvements in GDAL 2. Funded by Land Information New Zealand.
43 lines
1.5 KiB
Plaintext
43 lines
1.5 KiB
Plaintext
class QgsRasterIterator
|
|
{
|
|
%TypeHeaderCode
|
|
#include <qgsrasteriterator.h>
|
|
%End
|
|
public:
|
|
|
|
QgsRasterIterator( QgsRasterInterface* input );
|
|
|
|
/** 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.
|
|
*/
|
|
void startRasterRead( int bandNumber, int nCols, int nRows, const QgsRectangle& extent, QgsRasterBlockFeedback* feedback = nullptr );
|
|
|
|
/** 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*/
|
|
bool readNextRasterPart( int bandNumber,
|
|
int& nCols, int& nRows,
|
|
QgsRasterBlock **block,
|
|
int& topLeftCol, int& topLeftRow );
|
|
|
|
void stopRasterRead( int bandNumber );
|
|
|
|
const QgsRasterInterface* input() const;
|
|
|
|
void setMaximumTileWidth( int w );
|
|
int maximumTileWidth() const;
|
|
|
|
void setMaximumTileHeight( int h );
|
|
int maximumTileHeight() const;
|
|
};
|