20 #ifndef QGSRASTERDATAPROVIDER_H
21 #define QGSRASTERDATAPROVIDER_H
39 #define TINY_VALUE std::numeric_limits<double>::epsilon() * 20
61 ExactMinimumMaximum = 1 << 1,
62 ExactResolution = 1 << 2,
63 EstimatedMinimumMaximum = 1 << 3,
64 BuildPyramids = 1 << 4,
71 { UnknownDataType = 0, Byte = 1, UInt16 = 2, Int16 = 3, UInt32 = 4, Int32 = 5, Float32 = 6, Float64 = 7, CInt16 = 8, CInt32 = 9, CFloat32 = 10, CFloat64 = 11, ARGBDataType = 12,
91 UndefinedColorInterpretation = 0, GrayIndex = 1, PaletteIndex = 2, RedBand = 3, GreenBand = 4, BlueBand = 5, AlphaBand = 6, HueBand = 7, SaturationBand = 8, LightnessBand = 9, CyanBand = 10, MagentaBand = 11, YellowBand = 12, BlackBand = 13, YCbCr_YBand = 14, YCbCr_CbBand = 15, YCbCr_CrBand = 16, ColorInterpretationMax = 16
114 ProgressHistogram = 0,
115 ProgressPyramids = 1,
116 ProgressStatistics = 2
129 virtual void addLayers( QStringList
const & layers,
130 QStringList
const & styles = QStringList() ) = 0;
133 virtual QStringList supportedImageEncodings() = 0;
138 virtual QString imageEncoding()
const = 0;
143 virtual void setImageEncoding( QString
const & mimeType ) = 0;
148 virtual void setImageCrs( QString
const & crs ) = 0;
154 virtual QImage* draw(
QgsRectangle const & viewExtent,
int pixelWidth,
int pixelHeight ) = 0;
169 QString capabilitiesString()
const;
179 return srcDataType( bandNo );
226 return typeSize( dataType( bandNo ) );
238 Q_UNUSED( theBandNo );
245 switch ( colorInterpretation )
247 case UndefinedColorInterpretation:
307 return colorName( colorInterpretation( theBandNo ) );
315 virtual int xSize()
const {
return 0; }
316 virtual int ySize()
const {
return 0; }
320 virtual void readBlock(
int bandNo,
int xBlock,
int yBlock,
void *data )
321 { Q_UNUSED( bandNo ); Q_UNUSED( xBlock ); Q_UNUSED( yBlock ); Q_UNUSED( data ); }
325 { Q_UNUSED( bandNo ); Q_UNUSED( viewExtent ); Q_UNUSED( width ); Q_UNUSED( height ); Q_UNUSED( data ); }
331 virtual double readValue(
void *data,
int type,
int index );
336 virtual double minimumValue(
int bandNo )
const { Q_UNUSED( bandNo );
return 0; }
337 virtual double maximumValue(
int bandNo )
const { Q_UNUSED( bandNo );
return 0; }
339 virtual QList<QgsColorRampShader::ColorRampItem>
colorTable(
int bandNo )
const
340 { Q_UNUSED( bandNo );
return QList<QgsColorRampShader::ColorRampItem>(); }
346 return QStringList();
353 int theBinCountInt = 256,
354 bool theIgnoreOutOfRangeFlag =
true,
355 bool theThoroughBandScanFlag =
false
357 { Q_UNUSED( theBandNoInt ); Q_UNUSED( theBandStats ); Q_UNUSED( theBinCountInt ); Q_UNUSED( theIgnoreOutOfRangeFlag ); Q_UNUSED( theThoroughBandScanFlag ); }
360 virtual QString
buildPyramids(
const QList<QgsRasterPyramid> & thePyramidList,
361 const QString & theResamplingMethod =
"NEAREST",
362 bool theTryInternalFlag =
false )
363 { Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod ); Q_UNUSED( theTryInternalFlag );
return "FAILED_NOT_SUPPORTED"; };
380 return tr(
"Band" ) + QString(
" %1" ) .arg( theBandNumber, 1 + (
int ) log10((
float ) bandCount() ), 10, QChar(
'0' ) );
387 virtual QString metadata() = 0;
390 virtual bool identify(
const QgsPoint & point, QMap<QString, QString>& results );
405 virtual QString identifyAsText(
const QgsPoint& point ) = 0;
422 virtual QString identifyAsHtml(
const QgsPoint& point ) = 0;
433 virtual QString lastErrorTitle() = 0;
444 virtual QString lastError() = 0;
451 virtual QString lastErrorFormat();
468 int dpi()
const {
return mDpi;}
477 static QStringList cStringList2Q_(
char ** stringList );
479 static QString makeTableCell( QString
const & value );
480 static QString makeTableCells( QStringList
const & values );
483 QByteArray noValueBytes(
int theBandNo );
494 void progress(
int theType,
double theProgress, QString theMessage );