21 mMaximumTileWidth( 2000 ), mMaximumTileHeight( 2000 )
39 removePartInfo( bandNumber );
48 mRasterPartInfos.
insert( bandNumber, pInfo );
52 int& nCols,
int& nRows,
54 int& topLeftCol,
int& topLeftRow )
60 if ( partIt == mRasterPartInfos.
end() )
65 RasterPartInfo& pInfo = partIt.
value();
68 if ( 0 == pInfo.nCols || 0 == pInfo.nRows )
78 if ( pInfo.currentCol == pInfo.nCols && pInfo.currentRow == pInfo.nRows )
84 nCols = qMin( mMaximumTileWidth, pInfo.nCols - pInfo.currentCol );
85 nRows = qMin( mMaximumTileHeight, pInfo.nRows - pInfo.currentRow );
90 double xmin = viewPortExtent.
xMinimum() + pInfo.currentCol / ( double )pInfo.nCols * viewPortExtent.
width();
91 double xmax = viewPortExtent.
xMinimum() + ( pInfo.currentCol + nCols ) / (
double )pInfo.nCols * viewPortExtent.
width();
92 double ymin = viewPortExtent.
yMaximum() - ( pInfo.currentRow + nRows ) / (
double )pInfo.nRows * viewPortExtent.
height();
93 double ymax = viewPortExtent.
yMaximum() - pInfo.currentRow / ( double )pInfo.nRows * viewPortExtent.
height();
96 *block = mInput->
block( bandNumber, blockRect, nCols, nRows );
97 topLeftCol = pInfo.currentCol;
98 topLeftRow = pInfo.currentRow;
100 pInfo.currentCol += nCols;
101 if ( pInfo.currentCol == pInfo.nCols && pInfo.currentRow + nRows == pInfo.nRows )
103 pInfo.currentRow = pInfo.nRows;
105 else if ( pInfo.currentCol == pInfo.nCols )
107 pInfo.currentCol = 0;
108 pInfo.currentRow += nRows;
116 removePartInfo( bandNumber );
119 void QgsRasterIterator::removePartInfo(
int bandNumber )
122 if ( partIt != mRasterPartInfos.
end() )
124 RasterPartInfo& pInfo = partIt.
value();
126 mRasterPartInfos.
remove( bandNumber );
A rectangle specified with double values.
void startRasterRead(int bandNumber, int nCols, int nRows, const QgsRectangle &extent)
Start reading of raster band.
double yMaximum() const
Get the y maximum value (top side of rectangle)
QgsRasterIterator(QgsRasterInterface *input)
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 bl...
Base class for processing filters like renderers, reprojector, resampler etc.
void stopRasterRead(int bandNumber)
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height)=0
Read block of data using given extent and size.
iterator insert(const Key &key, const T &value)
double width() const
Width of the rectangle.
double xMinimum() const
Get the x minimum value (left side of rectangle)
iterator find(const Key &key)
double height() const
Height of the rectangle.
const T value(const Key &key) const
int remove(const Key &key)