QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
qgsrasternuller.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasternuller.h
3  -------------------
4  begin : August 2012
5  copyright : (C) 2012 by Radim Blazek
6  email : radim dot blazek at gmail dot com
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSRASTERNULLER_H
19 #define QGSRASTERNULLER_H
20 
21 #include "qgsrasterdataprovider.h"
22 #include "qgsrasterrange.h"
23 #include "qgsrasterinterface.h"
24 
25 #include <QList>
26 
30 class CORE_EXPORT QgsRasterNuller : public QgsRasterInterface
31 {
32  public:
33  QgsRasterNuller( QgsRasterInterface* input = 0 );
34  ~QgsRasterNuller();
35 
36  struct NoData
37  {
38  double min;
39  double max;
40  };
41 
42  QgsRasterInterface * clone() const;
43 
44  int bandCount() const;
45 
46  QGis::DataType dataType( int bandNo ) const;
47 
48  QgsRasterBlock* block( int bandNo, const QgsRectangle &extent, int width, int height );
49 
50  void setNoData( int bandNo, QgsRasterRangeList noData );
51 
52  QgsRasterRangeList noData( int bandNo ) const { return mNoData.value( bandNo -1 ); }
53 
55  void setOutputNoDataValue( int bandNo, double noData );
56 
57  private:
58  // no data indext from 0
59  QVector< QgsRasterRangeList > mNoData;
60  // no data to be set in output, indexed form 0
61  QVector<double> mOutputNoData;
62  QVector<bool> mHasOutputNoData;
63 };
64 
65 #endif // QGSRASTERNULLER_H