Quantum GIS API Documentation  master-ce49b66
QgsRasterIterator Class Reference

Iterator for sequentially processing raster cells. More...

#include <qgsrasteriterator.h>

+ Collaboration diagram for QgsRasterIterator:

List of all members.

Classes

struct  RasterPartInfo

Public Member Functions

 QgsRasterIterator (QgsRasterInterface *input)
 ~QgsRasterIterator ()
const QgsRasterInterfaceinput () const
int maximumTileHeight () const
int maximumTileWidth () const
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.
void setMaximumTileHeight (int h)
void setMaximumTileWidth (int w)
void startRasterRead (int bandNumber, int nCols, int nRows, const QgsRectangle &extent)
 Start reading of raster band.
void stopRasterRead (int bandNumber)

Private Member Functions

void removePartInfo (int bandNumber)
 Remove part into and release memory.

Private Attributes

QgsRectangle mExtent
QgsRasterInterfacemInput
int mMaximumTileHeight
int mMaximumTileWidth
QMap< int, RasterPartInfomRasterPartInfos

Detailed Description

Iterator for sequentially processing raster cells.

Definition at line 30 of file qgsrasteriterator.h.


Constructor & Destructor Documentation


Member Function Documentation

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.

Parameters:
bandNumberband to read
nColsnumber of columns on output device
nRowsnumber of rows on output device
blockaddress of block pointer
topLeftColtop left column
topLeftRowtop left row
Returns:
false if the last part was already returned

Definition at line 51 of file qgsrasteriterator.cpp.

References QgsRasterInterface::block(), QgsRasterIterator::RasterPartInfo::currentCol, QgsRasterIterator::RasterPartInfo::currentRow, QgsRectangle::height(), mExtent, mInput, mMaximumTileHeight, mMaximumTileWidth, mRasterPartInfos, QgsRasterIterator::RasterPartInfo::nCols, QgsRasterIterator::RasterPartInfo::nRows, QgsRasterIterator::RasterPartInfo::prj, QgsDebugMsg, QgsRectangle::width(), QgsRectangle::xMinimum(), and QgsRectangle::yMaximum().

Referenced by QgsRasterDrawer::draw(), QgsRasterFileWriter::writeDataRaster(), and QgsRasterFileWriter::writeImageRaster().

void QgsRasterIterator::removePartInfo ( int  bandNumber) [private]

Remove part into and release memory.

Definition at line 119 of file qgsrasteriterator.cpp.

References mRasterPartInfos, and QgsRasterIterator::RasterPartInfo::prj.

Referenced by startRasterRead(), and stopRasterRead().

void QgsRasterIterator::startRasterRead ( int  bandNumber,
int  nCols,
int  nRows,
const QgsRectangle extent 
)

Start reading of raster band.

Raster data can then be retrieved by calling readNextRasterPart until it returns false.

Parameters:
bandNumbernumber of raster band to read
nColsnumber of columns
nRowsnumber of rows
extentarea to read

Definition at line 29 of file qgsrasteriterator.cpp.

References QgsRasterIterator::RasterPartInfo::currentCol, QgsRasterIterator::RasterPartInfo::currentRow, mExtent, mInput, mRasterPartInfos, QgsRasterIterator::RasterPartInfo::nCols, QgsRasterIterator::RasterPartInfo::nRows, QgsRasterIterator::RasterPartInfo::prj, and removePartInfo().

Referenced by QgsRasterDrawer::draw(), QgsRasterFileWriter::writeDataRaster(), and QgsRasterFileWriter::writeImageRaster().

void QgsRasterIterator::stopRasterRead ( int  bandNumber)

Definition at line 114 of file qgsrasteriterator.cpp.

References removePartInfo().


Member Data Documentation

Definition at line 82 of file qgsrasteriterator.h.

Referenced by readNextRasterPart(), and startRasterRead().

Definition at line 85 of file qgsrasteriterator.h.

Referenced by readNextRasterPart().

Definition at line 84 of file qgsrasteriterator.h.

Referenced by readNextRasterPart().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines