QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsrasteriterator.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasteriterator.h
3  ---------------------
4  begin : July 2012
5  copyright : (C) 2012 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSRASTERITERATOR_H
16 #define QGSRASTERITERATOR_H
17 
18 #include "qgsrectangle.h"
19 #include <QMap>
20 
21 class QgsMapToPixel;
22 class QgsRasterBlock;
23 class QgsRasterInterface;
24 class QgsRasterProjector;
25 struct QgsRasterViewPort;
26 
30 class CORE_EXPORT QgsRasterIterator
31 {
32  public:
33 
36 
43  void startRasterRead( int bandNumber, int nCols, int nRows, const QgsRectangle& extent );
44 
54  bool readNextRasterPart( int bandNumber,
55  int& nCols, int& nRows,
56  QgsRasterBlock **block,
57  int& topLeftCol, int& topLeftRow );
58 
59  void stopRasterRead( int bandNumber );
60 
61  const QgsRasterInterface* input() const { return mInput; }
62 
63  void setMaximumTileWidth( int w ) { mMaximumTileWidth = w; }
64  int maximumTileWidth() const { return mMaximumTileWidth; }
65 
66  void setMaximumTileHeight( int h ) { mMaximumTileHeight = h; }
67  int maximumTileHeight() const { return mMaximumTileHeight; }
68 
69  private:
70  //Stores information about reading of a raster band. Columns and rows are in unsampled coordinates
72  {
75  int nCols;
76  int nRows;
77  QgsRasterProjector* prj; //raster projector (or 0 if no reprojection is done)
78  };
79 
81  QMap<int, RasterPartInfo> mRasterPartInfos;
83 
86 
88  void removePartInfo( int bandNumber );
89 };
90 
91 #endif // QGSRASTERITERATOR_H