23 #ifndef QGSRASTERDATAPROVIDER_H
24 #define QGSRASTERDATAPROVIDER_H
68 virtual void start() = 0;
72 void finish(
const QImage& legend );
73 void progress( qint64 received, qint64 total );
74 void error(
const QString& msg );
104 virtual QImage* draw(
const QgsRectangle & viewExtent,
int pixelWidth,
int pixelHeight ) = 0;
118 virtual int colorInterpretation(
int theBandNo )
const
120 Q_UNUSED( theBandNo );
124 QString colorName(
int colorInterpretation )
const
127 switch ( colorInterpretation )
187 virtual QString colorInterpretationName(
int theBandNo )
const
189 return colorName( colorInterpretation( theBandNo ) );
194 virtual double bandScale(
int bandNo )
const { Q_UNUSED( bandNo );
return 1.0; }
197 virtual double bandOffset(
int bandNo )
const { Q_UNUSED( bandNo );
return 0.0; }
205 virtual bool srcHasNoDataValue(
int bandNo )
const {
return mSrcHasNoDataValue.value( bandNo -1 ); }
208 virtual bool useSrcNoDataValue(
int bandNo )
const {
return mUseSrcNoDataValue.value( bandNo -1 ); }
211 virtual void setUseSrcNoDataValue(
int bandNo,
bool use );
214 virtual double srcNoDataValue(
int bandNo )
const {
return mSrcNoDataValue.value( bandNo -1 ); }
221 virtual QList<QgsColorRampShader::ColorRampItem> colorTable(
int bandNo )
const
222 { Q_UNUSED( bandNo );
return QList<QgsColorRampShader::ColorRampItem>(); }
228 return QStringList();
239 virtual QImage getLegendGraphic(
double scale = 0,
bool forceRefresh =
false,
const QgsRectangle * visibleExtent = 0 )
242 Q_UNUSED( forceRefresh );
243 Q_UNUSED( visibleExtent );
262 Q_UNUSED( mapSettings );
267 virtual QString buildPyramids(
const QList<QgsRasterPyramid> & thePyramidList,
268 const QString & theResamplingMethod =
"NEAREST",
270 const QStringList & theConfigOptions = QStringList() )
272 Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod );
273 Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions );
274 return "FAILED_NOT_SUPPORTED";
284 virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() )
285 { Q_UNUSED( overviewList );
return QList<QgsRasterPyramid>(); }
294 virtual QString metadata() = 0;
330 virtual QString lastErrorTitle() = 0;
341 virtual QString lastError() = 0;
344 virtual QString lastErrorFormat();
347 int dpi()
const {
return mDpi; }
360 virtual bool write(
void* data,
int band,
int width,
int height,
int xOffset,
int yOffset )
374 const QString& format,
int nBands,
376 int width,
int height,
double* geoTransform,
378 QStringList createOptions = QStringList() );
384 virtual bool setNoDataValue(
int bandNo,
double noDataValue ) { Q_UNUSED( bandNo ); Q_UNUSED( noDataValue );
return false; }
387 virtual bool remove() {
return false; }
391 static QList<QPair<QString, QString> > pyramidResamplingMethods( QString providerKey );
396 virtual QString validateCreationOptions(
const QStringList& createOptions, QString format )
397 { Q_UNUSED( createOptions ); Q_UNUSED( format );
return QString(); }
402 const QStringList & theConfigOptions,
const QString & fileFormat )
403 { Q_UNUSED( pyramidsFormat ); Q_UNUSED( theConfigOptions ); Q_UNUSED( fileFormat );
return QString(); }
413 void progress(
int theType,
double theProgress, QString theMessage );
414 void progressUpdate(
int theProgress );
419 virtual void readBlock(
int bandNo,
int xBlock,
int yBlock,
void *data )
420 { Q_UNUSED( bandNo ); Q_UNUSED( xBlock ); Q_UNUSED( yBlock ); Q_UNUSED( data ); }
424 virtual void readBlock(
int bandNo,
QgsRectangle const & viewExtent,
int width,
int height,
void *data )
425 { Q_UNUSED( bandNo ); Q_UNUSED( viewExtent ); Q_UNUSED( width ); Q_UNUSED( height ); Q_UNUSED( data ); }
428 bool userNoDataValuesContains(
int bandNo,
double value )
const;
433 static QStringList cStringList2Q_(
char ** stringList );
435 static QString makeTableCell(
const QString & value );
436 static QString makeTableCells(
const QStringList & values );
463 static void initPyramidResamplingDefs();