QGIS API Documentation  3.14.0-Pi (9f7028fd23)
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 "qgis_core.h"
22 #include "qgis_sip.h"
23 #include "qgsrasterinterface.h"
24 #include "qgsrasterresampler.h"
25 
26 class QDomElement;
27 
32 class CORE_EXPORT QgsRasterResampleFilter : public QgsRasterInterface
33 {
34  public:
35  QgsRasterResampleFilter( QgsRasterInterface *input = nullptr );
36 
37  QgsRasterResampleFilter *clone() const override SIP_FACTORY;
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, QgsRasterBlockFeedback *feedback = nullptr ) override SIP_FACTORY;
46 
48  void setZoomedInResampler( QgsRasterResampler *r SIP_TRANSFER );
49  const QgsRasterResampler *zoomedInResampler() const { return mZoomedInResampler.get(); }
50 
52  void setZoomedOutResampler( QgsRasterResampler *r SIP_TRANSFER );
53  const QgsRasterResampler *zoomedOutResampler() const { return mZoomedOutResampler.get(); }
54 
55  void setMaxOversampling( double os ) { mMaxOversampling = os; }
56  double maxOversampling() const { return mMaxOversampling; }
57 
58  void writeXml( QDomDocument &doc, QDomElement &parentElem ) const override;
59 
61  void readXml( const QDomElement &filterElem ) override;
62 
63  protected:
65  std::unique_ptr< QgsRasterResampler > mZoomedInResampler;
67  std::unique_ptr< QgsRasterResampler > mZoomedOutResampler;
68 
70  double mMaxOversampling = 2.0;
71 
72  private:
73 };
74 
75 #endif // QGSRASTERRESAMPLEFILTER_H
Qgis::DataType
DataType
Raster data types.
Definition: qgis.h:114
QgsRasterInterface::writeXml
virtual void writeXml(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
Definition: qgsrasterinterface.h:461
QgsRasterResampler
Definition: qgsrasterresampler.h:33
qgsrasterresampler.h
QgsRectangle
Definition: qgsrectangle.h:41
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
qgsrasterinterface.h
QgsRasterInterface::setInput
virtual bool setInput(QgsRasterInterface *input)
Set input.
Definition: qgsrasterinterface.h:266
QgsRasterInterface::dataType
virtual Qgis::DataType dataType(int bandNo) const =0
Returns data type for the band specified by number.
qgis_sip.h
SIP_TRANSFER
#define SIP_TRANSFER
Definition: qgis_sip.h:36
QgsRasterInterface::clone
virtual QgsRasterInterface * clone() const =0
Clone itself, create deep copy.
QgsRasterInterface::readXml
virtual void readXml(const QDomElement &filterElem)
Sets base class members from xml. Usually called from create() methods of subclasses.
Definition: qgsrasterinterface.h:463
QgsRasterResampleFilter::mZoomedInResampler
std::unique_ptr< QgsRasterResampler > mZoomedInResampler
Resampler used if screen resolution is higher than raster resolution (zoomed in). 0 means no resampli...
Definition: qgsrasterresamplefilter.h:65
QgsRasterResampleFilter::maxOversampling
double maxOversampling() const
Definition: qgsrasterresamplefilter.h:56
QgsRasterInterface
Definition: qgsrasterinterface.h:116
QgsRasterResampleFilter
Definition: qgsrasterresamplefilter.h:32
QgsRasterBlockFeedback
Definition: qgsrasterinterface.h:40
QgsRasterResampleFilter::mZoomedOutResampler
std::unique_ptr< QgsRasterResampler > mZoomedOutResampler
Resampler used if raster resolution is higher than raster resolution (zoomed out)....
Definition: qgsrasterresamplefilter.h:67
QgsRasterResampleFilter::zoomedInResampler
const QgsRasterResampler * zoomedInResampler() const
Definition: qgsrasterresamplefilter.h:49
QgsRasterInterface::bandCount
virtual int bandCount() const =0
Gets number of bands.
QgsRasterInterface::block
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.
QgsRasterResampleFilter::zoomedOutResampler
const QgsRasterResampler * zoomedOutResampler() const
Definition: qgsrasterresamplefilter.h:53
QgsRasterResampleFilter::setMaxOversampling
void setMaxOversampling(double os)
Definition: qgsrasterresamplefilter.h:55
QgsRasterBlock
Definition: qgsrasterblock.h:36