18 #ifndef QGSRASTERINTERFACE_H
19 #define QGSRASTERINTERFACE_H
21 #include "qgis_core.h"
25 #include <QCoreApplication>
86 void appendError(
const QString &error ) { mErrors.append( error ); }
94 QStringList
errors()
const {
return mErrors; }
102 bool mPreviewOnly =
false;
105 bool mRenderPartialOutput =
false;
141 sipType = sipType_QgsBrightnessContrastFilter;
143 sipType = sipType_QgsHueSaturationFilter;
146 sipType = sipType_QgsRasterDataProvider;
152 sipType = sipType_QgsRasterNuller;
154 sipType = sipType_QgsRasterProjector;
158 sipType = sipType_QgsHillshadeRenderer;
160 sipType = sipType_QgsMultiBandColorRenderer;
162 sipType = sipType_QgsPalettedRasterRenderer;
164 sipType = sipType_QgsSingleBandColorDataRenderer;
166 sipType = sipType_QgsSingleBandGrayRenderer;
168 sipType = sipType_QgsSingleBandPseudoColorRenderer;
170 sipType = sipType_QgsRasterRenderer;
173 sipType = sipType_QgsRasterResampleFilter;
189 BuildPyramids = 1 << 4,
191 IdentifyValue = 1 << 6,
192 IdentifyText = 1 << 7,
193 IdentifyHtml = 1 << 8,
194 IdentifyFeature = 1 << 9,
214 QString capabilitiesString()
const;
237 virtual int xBlockSize()
const {
return mInput ? mInput->xBlockSize() : 0; }
238 virtual int yBlockSize()
const {
return mInput ? mInput->yBlockSize() : 0; }
241 virtual int xSize()
const {
return mInput ? mInput->xSize() : 0; }
242 virtual int ySize()
const {
return mInput ? mInput->ySize() : 0; }
247 return tr(
"Band" ) + QStringLiteral(
" %1" ) .arg( bandNumber, 1 +
static_cast< int >( std::log10(
static_cast< double >( bandCount() ) ) ), 10, QChar(
'0' ) );
272 virtual bool on()
const {
return mOn; }
275 virtual void setOn(
bool on ) { mOn = on; }
286 return mInput ? mInput->sourceInput() :
this;
297 return mInput ? mInput->sourceInput() :
this;
317 virtual bool hasStatistics(
int bandNo,
320 int sampleSize = 0 );
339 double minimum = std::numeric_limits<double>::quiet_NaN(),
340 double maximum = std::numeric_limits<double>::quiet_NaN(),
343 bool includeOutOfRange =
false,
348 SIP_PYOBJECT minimum = Py_None,
349 SIP_PYOBJECT maximum = Py_None,
352 bool includeOutOfRange =
false,
356 double minimum = 0.0,
357 double maximum = 0.0,
360 bool includeOutOfRange =
false,
367 minimum = std::numeric_limits<double>::quiet_NaN();
371 minimum = PyFloat_AsDouble( a2 );
376 maximum = std::numeric_limits<double>::quiet_NaN();
380 maximum = PyFloat_AsDouble( a3 );
384 return sipConvertFromType( h, sipType_QgsRasterHistogram, Py_None );
394 virtual bool hasHistogram(
int bandNo,
396 double minimum = std::numeric_limits<double>::quiet_NaN(),
397 double maximum = std::numeric_limits<double>::quiet_NaN(),
400 bool includeOutOfRange =
false );
402 virtual bool hasHistogram(
int bandNo,
404 SIP_PYOBJECT minimum = Py_None,
405 SIP_PYOBJECT maximum = Py_None,
408 bool includeOutOfRange =
false )
411 double minimum = 0.0,
412 double maximum = 0.0,
415 bool includeOutOfRange =
false )];
421 minimum = std::numeric_limits<double>::quiet_NaN();
425 minimum = PyFloat_AsDouble( a2 );
430 maximum = std::numeric_limits<double>::quiet_NaN();
434 maximum = PyFloat_AsDouble( a3 );
437 sipRes = sipCpp->hasHistogram( a0, a1, minimum, maximum, *a4, a5, a6 );
452 virtual void cumulativeCut(
int bandNo,
458 int sampleSize = 0 );
461 virtual void writeXml( QDomDocument &doc, QDomElement &parentElem )
const { Q_UNUSED( doc ) Q_UNUSED( parentElem ); }
463 virtual void readXml(
const QDomElement &filterElem ) { Q_UNUSED( filterElem ) }
486 double minimum = std::numeric_limits<double>::quiet_NaN(),
487 double maximum = std::numeric_limits<double>::quiet_NaN(),
490 bool includeOutOfRange =
false );
495 SIP_PYOBJECT minimum = Py_None,
496 SIP_PYOBJECT maximum = Py_None,
499 bool includeOutOfRange =
false )
503 double minimum = 0.0,
504 double maximum = 0.0,
507 bool includeOutOfRange =
false )];
513 minimum = std::numeric_limits<double>::quiet_NaN();
517 minimum = PyFloat_AsDouble( a3 );
522 maximum = std::numeric_limits<double>::quiet_NaN();
526 maximum = PyFloat_AsDouble( a4 );
529 #if defined(SIP_PROTECTED_IS_PUBLIC)
530 sipCpp->initHistogram( *a0, a1, a2, minimum, maximum, *a5, a6, a7 );
532 sipCpp->sipProtect_initHistogram( *a0, a1, a2, minimum, maximum, *a5, a6, a7 );