QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsrasterresamplefilter.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrasterresamplefilter.h
3  -------------------
4  begin : December 2011
5  copyright : (C) 2011 by Marco Hugentobler
6  email : marco at sourcepole dot ch
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 QGSRASTERRESAMPLEFILTER_H
19 #define QGSRASTERRESAMPLEFILTER_H
20 
21 #include "qgsrasterdataprovider.h"
22 #include "qgsrasterinterface.h"
23 
24 class QgsRasterResampler;
25 
26 class QDomElement;
27 
31 class CORE_EXPORT QgsRasterResampleFilter : public QgsRasterInterface
32 {
33  public:
34  QgsRasterResampleFilter( QgsRasterInterface *input = nullptr );
36 
37  QgsRasterResampleFilter * clone() const override;
38 
39  int bandCount() const override;
40 
41  QGis::DataType dataType( int bandNo ) const override;
42 
43  bool setInput( QgsRasterInterface* input ) override;
44 
45  QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height ) override;
46  QgsRasterBlock *block2( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) override;
47 
49  void setZoomedInResampler( QgsRasterResampler* r );
50  const QgsRasterResampler* zoomedInResampler() const { return mZoomedInResampler; }
51 
53  void setZoomedOutResampler( QgsRasterResampler* r );
54  const QgsRasterResampler* zoomedOutResampler() const { return mZoomedOutResampler; }
55 
56  void setMaxOversampling( double os ) { mMaxOversampling = os; }
57  double maxOversampling() const { return mMaxOversampling; }
58 
59  void writeXML( QDomDocument& doc, QDomElement& parentElem ) const override;
60 
62  void readXML( const QDomElement& filterElem ) override;
63 
64  protected:
69 
72 
73  private:
74 };
75 
76 #endif // QGSRASTERRESAMPLEFILTER_H
virtual int bandCount() const =0
Get number of bands.
A rectangle specified with double values.
Definition: qgsrectangle.h:35
Interface for resampling rasters (e.g.
virtual void readXML(const QDomElement &filterElem)
Sets base class members from xml.
Resample filter pipe for rasters.
virtual QgsRasterBlock * block2(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)
Read block of data using given extent and size.
QgsRasterResampler * mZoomedOutResampler
Resampler used if raster resolution is higher than raster resolution (zoomed out).
Raster data container.
virtual void writeXML(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
virtual QGis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
Base class for processing filters like renderers, reprojector, resampler etc.
double mMaxOversampling
Maximum boundary for oversampling (to avoid too much data traffic).
virtual bool setInput(QgsRasterInterface *input)
Set input.
virtual QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
const QgsRasterResampler * zoomedOutResampler() const
DataType
Raster data types.
Definition: qgis.h:133
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height)=0
Read block of data using given extent and size.
QgsRasterResampler * mZoomedInResampler
Resampler used if screen resolution is higher than raster resolution (zoomed in). ...
Feedback object tailored for raster block reading.
const QgsRasterResampler * zoomedInResampler() const