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 ) );
166 virtual double bandScale(
int bandNo )
const { Q_UNUSED( bandNo );
return 1.0; }
169 virtual double bandOffset(
int bandNo )
const { Q_UNUSED( bandNo );
return 0.0; }
177 virtual bool srcHasNoDataValue(
int bandNo )
const {
return mSrcHasNoDataValue.value( bandNo -1 ); }
180 virtual bool useSrcNoDataValue(
int bandNo )
const {
return mUseSrcNoDataValue.value( bandNo -1 ); }
183 virtual void setUseSrcNoDataValue(
int bandNo,
bool use );
186 virtual double srcNoDataValue(
int bandNo )
const {
return mSrcNoDataValue.value( bandNo -1 ); }
193 virtual QList<QgsColorRampShader::ColorRampItem> colorTable(
int bandNo )
const
194 { Q_UNUSED( bandNo );
return QList<QgsColorRampShader::ColorRampItem>(); }
200 return QStringList();
205 virtual QImage getLegendGraphic(
double scale = 0,
bool forceRefresh =
false )
208 Q_UNUSED( forceRefresh );
213 virtual QString buildPyramids(
const QList<QgsRasterPyramid> & thePyramidList,
214 const QString & theResamplingMethod =
"NEAREST",
216 const QStringList & theConfigOptions = QStringList() )
218 Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod );
219 Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions );
220 return "FAILED_NOT_SUPPORTED";
230 virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() )
231 { Q_UNUSED( overviewList );
return QList<QgsRasterPyramid>(); };
240 virtual QString metadata() = 0;
276 virtual QString lastErrorTitle() = 0;
287 virtual QString lastError() = 0;
290 virtual QString lastErrorFormat();
293 int dpi()
const {
return mDpi; }
306 virtual bool write(
void* data,
int band,
int width,
int height,
int xOffset,
int yOffset )
320 const QString& format,
int nBands,
322 int width,
int height,
double* geoTransform,
324 QStringList createOptions = QStringList() );
330 virtual bool setNoDataValue(
int bandNo,
double noDataValue ) { Q_UNUSED( bandNo ); Q_UNUSED( noDataValue );
return false; }
333 virtual bool remove() {
return false; }
337 static QList<QPair<QString, QString> > pyramidResamplingMethods( QString providerKey );
342 virtual QString validateCreationOptions(
const QStringList& createOptions, QString format )
343 { Q_UNUSED( createOptions ); Q_UNUSED( format );
return QString(); }
348 const QStringList & theConfigOptions,
const QString & fileFormat )
349 { Q_UNUSED( pyramidsFormat ); Q_UNUSED( theConfigOptions ); Q_UNUSED( fileFormat );
return QString(); }
359 void progress(
int theType,
double theProgress, QString theMessage );
360 void progressUpdate(
int theProgress );
365 virtual void readBlock(
int bandNo,
int xBlock,
int yBlock,
void *data )
366 { Q_UNUSED( bandNo ); Q_UNUSED( xBlock ); Q_UNUSED( yBlock ); Q_UNUSED( data ); }
370 virtual void readBlock(
int bandNo,
QgsRectangle const & viewExtent,
int width,
int height,
void *data )
371 { Q_UNUSED( bandNo ); Q_UNUSED( viewExtent ); Q_UNUSED( width ); Q_UNUSED( height ); Q_UNUSED( data ); }
374 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 );
409 static void initPyramidResamplingDefs();