QGIS API Documentation  2.99.0-Master (8ec3eaf)
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 "qgsrasterinterface.h"
22 
23 class QgsRasterResampler;
24 
25 class QDomElement;
26 
30 class CORE_EXPORT QgsRasterResampleFilter : public QgsRasterInterface
31 {
32  public:
33  QgsRasterResampleFilter( QgsRasterInterface *input = nullptr );
35 
36  QgsRasterResampleFilter * clone() const override;
37 
38  int bandCount() const override;
39 
40  Qgis::DataType dataType( int bandNo ) const override;
41 
42  bool setInput( QgsRasterInterface* input ) override;
43 
44  QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) override;
45 
47  void setZoomedInResampler( QgsRasterResampler* r );
48  const QgsRasterResampler* zoomedInResampler() const { return mZoomedInResampler; }
49 
51  void setZoomedOutResampler( QgsRasterResampler* r );
52  const QgsRasterResampler* zoomedOutResampler() const { return mZoomedOutResampler; }
53 
54  void setMaxOversampling( double os ) { mMaxOversampling = os; }
55  double maxOversampling() const { return mMaxOversampling; }
56 
57  void writeXml( QDomDocument& doc, QDomElement& parentElem ) const override;
58 
60  void readXml( const QDomElement& filterElem ) override;
61 
62  protected:
67 
70 
71  private:
72 };
73 
74 #endif // QGSRASTERRESAMPLEFILTER_H
virtual int bandCount() const =0
Get number of bands.
A rectangle specified with double values.
Definition: qgsrectangle.h:35
virtual void readXml(const QDomElement &filterElem)
Sets base class members from xml. Usually called from create() methods of subclasses.
Interface for resampling rasters (e.g.
DataType
Raster data types.
Definition: qgis.h:60
Resample filter pipe for rasters.
virtual Qgis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
QgsRasterResampler * mZoomedOutResampler
Resampler used if raster resolution is higher than raster resolution (zoomed out). 0 mean no resampling (nearest neighbour)
Raster data container.
virtual QgsRasterBlock * block(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)=0
Read block of data using given extent and size.
Base class for processing filters like renderers, reprojector, resampler etc.
double mMaxOversampling
Maximum boundary for oversampling (to avoid too much data traffic). Default: 2.0. ...
virtual bool setInput(QgsRasterInterface *input)
Set input.
virtual QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
const QgsRasterResampler * zoomedOutResampler() const
QgsRasterResampler * mZoomedInResampler
Resampler used if screen resolution is higher than raster resolution (zoomed in). 0 means no resampli...
virtual void writeXml(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Feedback object tailored for raster block reading.
const QgsRasterResampler * zoomedInResampler() const