18 #ifndef QGSRASTERINTERFACE_H 19 #define QGSRASTERINTERFACE_H 23 #include <QCoreApplication> 69 bool mRenderPartialOutput;
88 BuildPyramids = 1 << 4,
90 IdentifyValue = 1 << 6,
91 IdentifyText = 1 << 7,
92 IdentifyHtml = 1 << 8,
93 IdentifyFeature = 1 << 9,
112 QString capabilitiesString()
const;
130 virtual int bandCount()
const = 0;
133 virtual int xBlockSize()
const {
return mInput ? mInput->xBlockSize() : 0; }
134 virtual int yBlockSize()
const {
return mInput ? mInput->yBlockSize() : 0; }
137 virtual int xSize()
const {
return mInput ? mInput->xSize() : 0; }
138 virtual int ySize()
const {
return mInput ? mInput->ySize() : 0; }
143 return tr(
"Band" ) +
QString(
" %1" ) .
arg( theBandNumber, 1 + static_cast< int >( log10( static_cast< double >( bandCount() ) ) ), 10,
QChar(
'0' ) );
169 Q_UNUSED( feedback );
170 return block( bandNo, extent, width, height );
181 virtual bool on()
const {
return mOn; }
184 virtual void setOn(
bool on ) { mOn = on; }
193 return mInput ? mInput->srcInput() :
this;
198 return mInput ? mInput->srcInput() :
this;
211 int theSampleSize = 0 );
216 virtual bool hasStatistics(
int theBandNo,
219 int theSampleSize = 0 );
234 double theMinimum = std::numeric_limits<double>::quiet_NaN(),
235 double theMaximum = std::numeric_limits<double>::quiet_NaN(),
237 int theSampleSize = 0,
238 bool theIncludeOutOfRange =
false );
243 virtual bool hasHistogram(
int theBandNo,
245 double theMinimum = std::numeric_limits<double>::quiet_NaN(),
246 double theMaximum = std::numeric_limits<double>::quiet_NaN(),
248 int theSampleSize = 0,
249 bool theIncludeOutOfRange =
false );
260 virtual void cumulativeCut(
int theBandNo,
261 double theLowerCount,
262 double theUpperCount,
263 double &theLowerValue,
264 double &theUpperValue,
266 int theSampleSize = 0 );
291 double theMinimum = std::numeric_limits<double>::quiet_NaN(),
292 double theMaximum = std::numeric_limits<double>::quiet_NaN(),
294 int theSampleSize = 0,
295 bool theIncludeOutOfRange =
false );
301 int theBinCount = 0 );
virtual void onNewData()
May be emitted by raster data provider to indicate that some partial data are available and a new pre...
A rectangle specified with double values.
bool renderPartialOutput() const
Whether our painter is drawing to a temporary image used just by this layer.
Unknown or unspecified type.
virtual QString generateBandName(int theBandNumber) const
helper function to create zero padded band names
virtual void readXML(const QDomElement &filterElem)
Sets base class members from xml.
virtual QgsRasterInterface * input() const
Current input.
virtual int ySize() const
Capability
If you add to this, please also add to capabilitiesString()
void setRenderPartialOutput(bool enable)
Set whether our painter is drawing to a temporary image used just by this layer.
virtual QgsRasterBlock * block2(int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback=nullptr)
Read block of data using given extent and size.
virtual int xBlockSize() const
Get block size.
Base class for feedback objects to be used for cancellation of something running in a worker thread...
The RasterBandStats struct is a container for statistics about a single raster band.
void setPreviewOnly(bool preview)
set flag whether the block request is for preview purposes only
#define QgsDebugMsgLevel(str, level)
virtual int capabilities() const
Returns a bitmask containing the supported capabilities.
virtual void setOn(bool on)
Set on/off.
QList< QgsRasterHistogram > mHistograms
List of cached histograms, all bands mixed.
virtual void writeXML(QDomDocument &doc, QDomElement &parentElem) const
Write base class members to xml.
QgsRasterBlockFeedback(QObject *parent=nullptr)
Construct a new raster block feedback object.
virtual QGis::DataType srcDataType(int bandNo) const
Returns source data type for the band specified by number, source data type may be shorter than dataT...
static int typeSize(int dataType)
Base class for processing filters like renderers, reprojector, resampler etc.
virtual QgsRasterInterface * srcInput()
virtual bool setInput(QgsRasterInterface *input)
Set input.
virtual QgsRectangle extent()
Get the extent of the interface.
virtual bool on() const
Is on/off.
virtual int yBlockSize() const
DataType
Raster data types.
bool isPreviewOnly() const
Whether the raster provider should return only data that are already available without waiting for fu...
int dataTypeSize(int bandNo)
virtual const QgsRasterInterface * srcInput() const
Get source / raw input, the first in pipe, usually provider.
The QgsRasterHistogram is a container for histogram of a single raster band.
QList< QgsRasterBandStats > mStatistics
List of cached statistics, all bands mixed.
QgsRasterInterface * mInput
Feedback object tailored for raster block reading.
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
virtual int xSize() const
Get raster size.