20 #ifndef QGSRASTERDATAPROVIDER_H
21 #define QGSRASTERDATAPROVIDER_H
69 virtual QImage* draw(
const QgsRectangle & viewExtent,
int pixelWidth,
int pixelHeight ) = 0;
83 virtual int colorInterpretation(
int theBandNo )
const
85 Q_UNUSED( theBandNo );
89 QString colorName(
int colorInterpretation )
const
92 switch ( colorInterpretation )
152 virtual QString colorInterpretationName(
int theBandNo )
const
154 return colorName( colorInterpretation( theBandNo ) );
163 virtual bool srcHasNoDataValue(
int bandNo )
const {
return mSrcHasNoDataValue.value( bandNo -1 ); }
166 virtual bool useSrcNoDataValue(
int bandNo )
const {
return mUseSrcNoDataValue.value( bandNo -1 ); }
169 virtual void setUseSrcNoDataValue(
int bandNo,
bool use );
172 virtual double srcNoDataValue(
int bandNo )
const {
return mSrcNoDataValue.value( bandNo -1 ); }
179 virtual QList<QgsColorRampShader::ColorRampItem> colorTable(
int bandNo )
const
180 { Q_UNUSED( bandNo );
return QList<QgsColorRampShader::ColorRampItem>(); }
186 return QStringList();
190 virtual QString buildPyramids(
const QList<QgsRasterPyramid> & thePyramidList,
191 const QString & theResamplingMethod =
"NEAREST",
193 const QStringList & theConfigOptions = QStringList() )
195 Q_UNUSED( thePyramidList ); Q_UNUSED( theResamplingMethod );
196 Q_UNUSED( theFormat ); Q_UNUSED( theConfigOptions );
197 return "FAILED_NOT_SUPPORTED";
207 virtual QList<QgsRasterPyramid> buildPyramidList( QList<int> overviewList = QList<int>() )
208 { Q_UNUSED( overviewList );
return QList<QgsRasterPyramid>(); };
217 virtual QString metadata() = 0;
253 virtual QString lastErrorTitle() = 0;
264 virtual QString lastError() = 0;
271 virtual QString lastErrorFormat();
275 int dpi()
const {
return mDpi;}
289 virtual bool write(
void* data,
int band,
int width,
int height,
int xOffset,
int yOffset )
303 const QString& format,
int nBands,
305 int width,
int height,
double* geoTransform,
307 QStringList createOptions = QStringList() );
313 virtual bool setNoDataValue(
int bandNo,
double noDataValue ) { Q_UNUSED( bandNo ); Q_UNUSED( noDataValue );
return false; }
320 virtual bool remove() {
return false; }
324 static QList<QPair<QString, QString> > pyramidResamplingMethods( QString providerKey );
329 virtual QString validateCreationOptions(
const QStringList& createOptions, QString format )
330 { Q_UNUSED( createOptions ); Q_UNUSED( format );
return QString(); }
335 const QStringList & theConfigOptions,
const QString & fileFormat )
336 { Q_UNUSED( pyramidsFormat ); Q_UNUSED( theConfigOptions ); Q_UNUSED( fileFormat );
return QString(); }
346 void progress(
int theType,
double theProgress, QString theMessage );
347 void progressUpdate(
int theProgress );
352 virtual void readBlock(
int bandNo,
int xBlock,
int yBlock,
void *data )
353 { Q_UNUSED( bandNo ); Q_UNUSED( xBlock ); Q_UNUSED( yBlock ); Q_UNUSED( data ); }
357 virtual void readBlock(
int bandNo,
QgsRectangle const & viewExtent,
int width,
int height,
void *data )
358 { Q_UNUSED( bandNo ); Q_UNUSED( viewExtent ); Q_UNUSED( width ); Q_UNUSED( height ); Q_UNUSED( data ); }
361 bool userNoDataValuesContains(
int bandNo,
double value )
const;
363 static QStringList cStringList2Q_(
char ** stringList );
365 static QString makeTableCell(
const QString & value );
366 static QString makeTableCells(
const QStringList & values );
394 static void initPyramidResamplingDefs();