QGIS API Documentation  2.99.0-Master (e077efd)
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 "qgsrasterrange.h"
22 #include "qgsrasterinterface.h"
23 
24 #include <QList>
25 
29 class CORE_EXPORT QgsRasterNuller : public QgsRasterInterface
30 {
31  public:
32  QgsRasterNuller( QgsRasterInterface* input = nullptr );
33  ~QgsRasterNuller();
34 
35  struct NoData
36  {
37  double min;
38  double max;
39  };
40 
41  QgsRasterNuller * clone() const override;
42 
43  int bandCount() const override;
44 
45  Qgis::DataType dataType( int bandNo ) const override;
46 
47  QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) override;
48 
49  void setNoData( int bandNo, const QgsRasterRangeList& noData );
50 
51  QgsRasterRangeList noData( int bandNo ) const { return mNoData.value( bandNo -1 ); }
52 
54  void setOutputNoDataValue( int bandNo, double noData );
55 
56  private:
57  // no data indext from 0
58  QVector< QgsRasterRangeList > mNoData;
59  // no data to be set in output, indexed form 0
60  QVector<double> mOutputNoData;
61  QVector<bool> mHasOutputNoData;
62 };
63 
64 #endif // QGSRASTERNULLER_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Raster pipe that deals with null values.
DataType
Raster data types.
Definition: qgis.h:60
Raster data container.
QgsRasterRangeList noData(int bandNo) const
Base class for processing filters like renderers, reprojector, resampler etc.
QList< QgsRasterRange > QgsRasterRangeList
Feedback object tailored for raster block reading.