20 #ifndef QGSRASTERDATAPROVIDER_H
21 #define QGSRASTERDATAPROVIDER_H
76 virtual QImage* draw(
const QgsRectangle & viewExtent,
int pixelWidth,
int pixelHeight ) = 0;
90 virtual int colorInterpretation(
int theBandNo )
const
92 Q_UNUSED( theBandNo );
96 QString colorName(
int colorInterpretation )
const
99 switch ( colorInterpretation )
159 virtual QString colorInterpretationName(
int theBandNo )
const
161 return colorName( colorInterpretation( theBandNo ) );
170 virtual bool srcHasNoDataValue(
int bandNo )
const {
return mSrcHasNoDataValue.value( bandNo -1 ); }
173 virtual bool useSrcNoDataValue(
int bandNo )
const {
return mUseSrcNoDataValue.value( bandNo -1 ); }
176 virtual void setUseSrcNoDataValue(
int bandNo,
bool use );
179 virtual double srcNoDataValue(
int bandNo )
const {
return mSrcNoDataValue.value( bandNo -1 ); }
186 virtual QList<QgsColorRampShader::ColorRampItem> colorTable(
int bandNo )
const
187 { Q_UNUSED( bandNo );
return QList<QgsColorRampShader::ColorRampItem>(); }
193 return QStringList();
198 virtual QImage getLegendGraphic(
double scale = 0,
bool forceRefresh =
false )
201 Q_UNUSED( forceRefresh );
206 virtual QString buildPyramids(
const QList<QgsRasterPyramid> & thePyramidList,
207 const QString & theResamplingMethod =
"NEAREST",
209 const QStringList & theConfigOptions = QStringList() )
211 Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod );
212 Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions );
213 return "FAILED_NOT_SUPPORTED";
223 virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() )
224 { Q_UNUSED( overviewList );
return QList<QgsRasterPyramid>(); };
233 virtual QString metadata() = 0;
269 virtual QString lastErrorTitle() = 0;
280 virtual QString lastError() = 0;
287 virtual QString lastErrorFormat();
291 int dpi()
const {
return mDpi;}
305 virtual bool write(
void* data,
int band,
int width,
int height,
int xOffset,
int yOffset )
319 const QString& format,
int nBands,
321 int width,
int height,
double* geoTransform,
323 QStringList createOptions = QStringList() );
329 virtual bool setNoDataValue(
int bandNo,
double noDataValue ) { Q_UNUSED( bandNo ); Q_UNUSED( noDataValue );
return false; }
336 virtual bool remove() {
return false; }
340 static QList<QPair<QString, QString> > pyramidResamplingMethods( QString providerKey );
345 virtual QString validateCreationOptions(
const QStringList& createOptions, QString format )
346 { Q_UNUSED( createOptions ); Q_UNUSED( format );
return QString(); }
351 const QStringList & theConfigOptions,
const QString & fileFormat )
352 { Q_UNUSED( pyramidsFormat ); Q_UNUSED( theConfigOptions ); Q_UNUSED( fileFormat );
return QString(); }
362 void progress(
int theType,
double theProgress, QString theMessage );
363 void progressUpdate(
int theProgress );
368 virtual void readBlock(
int bandNo,
int xBlock,
int yBlock,
void *data )
369 { Q_UNUSED( bandNo ); Q_UNUSED( xBlock ); Q_UNUSED( yBlock ); Q_UNUSED( data ); }
373 virtual void readBlock(
int bandNo,
QgsRectangle const & viewExtent,
int width,
int height,
void *data )
374 { Q_UNUSED( bandNo ); Q_UNUSED( viewExtent ); Q_UNUSED( width ); Q_UNUSED( height ); Q_UNUSED( data ); }
377 bool userNoDataValuesContains(
int bandNo,
double value )
const;
379 static QStringList cStringList2Q_(
char ** stringList );
381 static QString makeTableCell(
const QString & value );
382 static QString makeTableCells(
const QStringList & values );
410 static void initPyramidResamplingDefs();