18 #ifndef QGSRASTERINTERFACE_H
19 #define QGSRASTERINTERFACE_H
21 #include "qgis_core.h"
25 #include <QCoreApplication>
53 virtual void onNewData() {}
60 bool isPreviewOnly()
const {
return mPreviewOnly; }
66 void setPreviewOnly(
bool preview ) { mPreviewOnly = preview; }
72 bool renderPartialOutput()
const {
return mRenderPartialOutput; }
78 void setRenderPartialOutput(
bool enable ) { mRenderPartialOutput = enable; }
87 void appendError(
const QString &error ) { mErrors.append( error ); }
95 QStringList errors()
const {
return mErrors; }
119 bool mPreviewOnly =
false;
122 bool mRenderPartialOutput =
false;
160 sipType = sipType_QgsBrightnessContrastFilter;
162 sipType = sipType_QgsHueSaturationFilter;
165 sipType = sipType_QgsRasterDataProvider;
171 sipType = sipType_QgsRasterNuller;
173 sipType = sipType_QgsRasterProjector;
177 sipType = sipType_QgsHillshadeRenderer;
179 sipType = sipType_QgsMultiBandColorRenderer;
181 sipType = sipType_QgsPalettedRasterRenderer;
183 sipType = sipType_QgsSingleBandColorDataRenderer;
185 sipType = sipType_QgsSingleBandGrayRenderer;
187 sipType = sipType_QgsSingleBandPseudoColorRenderer;
189 sipType = sipType_QgsRasterRenderer;
192 sipType = sipType_QgsRasterResampleFilter;
208 BuildPyramids = 1 << 4,
210 IdentifyValue = 1 << 6,
211 IdentifyText = 1 << 7,
212 IdentifyHtml = 1 << 8,
213 IdentifyFeature = 1 << 9,
233 QString capabilitiesString()
const;
256 virtual int bandCount()
const = 0;
259 virtual int xBlockSize()
const {
return mInput ? mInput->xBlockSize() : 0; }
260 virtual int yBlockSize()
const {
return mInput ? mInput->yBlockSize() : 0; }
263 virtual int xSize()
const {
return mInput ? mInput->xSize() : 0; }
264 virtual int ySize()
const {
return mInput ? mInput->ySize() : 0; }
267 virtual QString generateBandName(
int bandNumber )
const;
274 virtual QString colorInterpretationName(
int bandNumber )
const;
281 QString displayBandName(
int bandNumber )
const;
305 virtual bool on()
const {
return mOn; }
308 virtual void setOn(
bool on ) { mOn = on; }
319 return mInput ? mInput->sourceInput() :
this;
330 return mInput ? mInput->sourceInput() :
this;
350 virtual bool hasStatistics(
int bandNo,
353 int sampleSize = 0 );
372 double minimum = std::numeric_limits<double>::quiet_NaN(),
373 double maximum = std::numeric_limits<double>::quiet_NaN(),
376 bool includeOutOfRange =
false,
381 SIP_PYOBJECT minimum = Py_None,
382 SIP_PYOBJECT maximum = Py_None,
385 bool includeOutOfRange =
false,
389 double minimum = 0.0,
390 double maximum = 0.0,
393 bool includeOutOfRange =
false,
400 minimum = std::numeric_limits<double>::quiet_NaN();
404 minimum = PyFloat_AsDouble( a2 );
409 maximum = std::numeric_limits<double>::quiet_NaN();
413 maximum = PyFloat_AsDouble( a3 );
417 return sipConvertFromType( h, sipType_QgsRasterHistogram, Py_None );
427 virtual bool hasHistogram(
int bandNo,
429 double minimum = std::numeric_limits<double>::quiet_NaN(),
430 double maximum = std::numeric_limits<double>::quiet_NaN(),
433 bool includeOutOfRange =
false );
435 virtual bool hasHistogram(
int bandNo,
437 SIP_PYOBJECT minimum = Py_None,
438 SIP_PYOBJECT maximum = Py_None,
441 bool includeOutOfRange =
false )
444 double minimum = 0.0,
445 double maximum = 0.0,
448 bool includeOutOfRange =
false )];
454 minimum = std::numeric_limits<double>::quiet_NaN();
458 minimum = PyFloat_AsDouble( a2 );
463 maximum = std::numeric_limits<double>::quiet_NaN();
467 maximum = PyFloat_AsDouble( a3 );
470 sipRes = sipCpp->hasHistogram( a0, a1, minimum, maximum, *a4, a5, a6 );
485 virtual void cumulativeCut(
int bandNo,
491 int sampleSize = 0 );
494 virtual void writeXml( QDomDocument &doc, QDomElement &parentElem )
const { Q_UNUSED( doc ) Q_UNUSED( parentElem ); }
496 virtual void readXml(
const QDomElement &filterElem ) { Q_UNUSED( filterElem ) }
519 double minimum = std::numeric_limits<double>::quiet_NaN(),
520 double maximum = std::numeric_limits<double>::quiet_NaN(),
523 bool includeOutOfRange =
false );
528 SIP_PYOBJECT minimum = Py_None,
529 SIP_PYOBJECT maximum = Py_None,
532 bool includeOutOfRange =
false )
536 double minimum = 0.0,
537 double maximum = 0.0,
540 bool includeOutOfRange =
false )];
546 minimum = std::numeric_limits<double>::quiet_NaN();
550 minimum = PyFloat_AsDouble( a3 );
555 maximum = std::numeric_limits<double>::quiet_NaN();
559 maximum = PyFloat_AsDouble( a4 );
562 #if defined(SIP_PROTECTED_IS_PUBLIC) || (SIP_VERSION >= 0x050000 && !defined(_MSC_VER))
563 sipCpp->initHistogram( *a0, a1, a2, minimum, maximum, *a5, a6, a7 );
565 sipCpp->sipProtect_initHistogram( *a0, a1, a2, minimum, maximum, *a5, a6, a7 );
574 int binCount = 0 )
const;