21 #ifndef QGSRASTERLAYER_H
22 #define QGSRASTERLAYER_H
24 #include "qgis_core.h"
117 : loadDefaultStyle( loadDefaultStyle )
118 , transformContext( transformContext )
122 bool loadDefaultStyle =
true;
143 bool skipCrsValidation =
false;
160 const QString &baseName = QString(),
161 const QString &providerType =
"gdal",
167 SIP_PYOBJECT __repr__();
169 QString
str = QStringLiteral(
"<QgsRasterLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral(
"Invalid" ) );
170 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
209 static bool isValidRasterFileName(
const QString &fileNameQString, QString &retError );
212 static bool isValidRasterFileName(
const QString &fileNameQString );
215 static QDateTime lastModified(
const QString &name );
221 Q_DECL_DEPRECATED
void setDataProvider(
const QString &provider )
SIP_DEPRECATED;
230 void setDataProvider(
const QString &provider,
const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags = QgsDataProvider::ReadFlags() );
312 int bandCount()
const;
317 QString bandName(
int bandNoInt )
const;
333 void reload() override;
337 void draw( QPainter *theQPainter,
348 bool isSpatial()
const override {
return true; }
351 Qgis::MapLayerProperties
properties()
const override;
357 QPixmap paletteAsPixmap(
int bandNumber = 1 );
370 double rasterUnitsPerPixelX()
const;
379 double rasterUnitsPerPixelY()
const;
396 bool generateLookupTableFlag = true );
415 virtual QString subsetString() const;
425 virtual
bool setSubsetString( const QString &subset );
431 bool defaultContrastEnhancementSettings(
436 void setDefaultContrastEnhancement();
438 QStringList subLayers() const override;
444 QImage previewAsImage( QSize size, const QColor &bgColor = Qt::white,
445 QImage::Format format = QImage::Format_ARGB32_Premultiplied );
447 void setLayerOrder( const QStringList &layers ) override;
448 void setSubLayerVisibility( const QString &name,
bool vis ) override;
449 QDateTime timestamp() const override;
461 bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QVariantMap &props = QVariantMap() ) const;
471 bool ignoreExtents() const;
477 void showStatusMessage( const QString &message );
492 void subsetStringChanged();
499 bool writeSymbology( QDomNode &, QDomDocument &doc, QString &errorMessage,
501 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
503 bool writeXml( QDomNode &layer_node, QDomDocument &doc, const
QgsReadWriteContext &context ) const override;
504 QString encodedSource( const QString &source, const
QgsReadWriteContext &context ) const override;
505 QString decodedSource( const QString &source, const QString &provider, const
QgsReadWriteContext &context ) const override;
512 void closeDataProvider();
518 void setRendererForDrawingStyle(
QgsRaster::DrawingStyle drawingStyle );
524 bool generateLookupTableFlag,
530 void computeMinMax(
int band,
535 double &min,
double &max );
548 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const
QgsDataProvider::ProviderOptions &options,
QgsDataProvider::ReadFlags flags ) override;
551 const QString QSTRING_NOT_SET;
552 const QString TRSTRING_NOT_SET;
563 QDateTime mLastModified;
567 LayerType mRasterType = GrayOrUndefined;
572 QgsRectangle mLastRectangleUsedByRefreshContrastEnhancementIfNeeded;
574 QDomDocument mOriginalStyleDocument;
575 QDomElement mOriginalStyleElement;