21 #ifndef QGSRASTERLAYER_H 22 #define QGSRASTERLAYER_H 24 #include "qgis_core.h" 178 : loadDefaultStyle( loadDefaultStyle )
179 , transformContext( transformContext )
183 bool loadDefaultStyle =
true;
204 bool skipCrsValidation =
false;
224 const QString &baseName = QString(),
225 const QString &providerType =
"gdal",
263 static bool isValidRasterFileName(
const QString &fileNameQString, QString &retError );
266 static bool isValidRasterFileName(
const QString &fileNameQString );
269 static QDateTime lastModified(
const QString &name );
275 Q_DECL_DEPRECATED
void setDataProvider(
const QString &provider )
SIP_DEPRECATED;
297 void setDataSource(
const QString &dataSource,
const QString &baseName,
const QString &provider,
const QgsDataProvider::ProviderOptions &options,
bool loadDefaultStyleFlag =
false )
override;
361 int bandCount()
const;
366 QString bandName(
int bandNoInt )
const;
382 void reload()
override;
386 void draw( QPainter *theQPainter,
395 QString htmlMetadata()
const override;
401 QPixmap paletteAsPixmap(
int bandNumber = 1 );
404 QString providerType()
const;
414 double rasterUnitsPerPixelX()
const;
423 double rasterUnitsPerPixelY()
const;
438 bool generateLookupTableFlag =
true );
456 bool defaultContrastEnhancementSettings(
461 void setDefaultContrastEnhancement();
463 QStringList subLayers()
const override;
468 QImage previewAsImage( QSize size,
const QColor &bgColor = Qt::white,
469 QImage::Format format = QImage::Format_ARGB32_Premultiplied );
471 void setLayerOrder(
const QStringList &layers )
override;
472 void setSubLayerVisibility(
const QString &name,
bool vis )
override;
473 QDateTime timestamp()
const override;
485 bool writeSld( QDomNode &node, QDomDocument &doc, QString &errorMessage,
const QgsStringMap &props =
QgsStringMap() )
const;
495 bool ignoreExtents()
const;
498 void showStatusMessage(
const QString &message );
511 bool writeSymbology( QDomNode &, QDomDocument &doc, QString &errorMessage,
513 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage,
515 bool writeXml( QDomNode &layer_node, QDomDocument &doc,
const QgsReadWriteContext &context )
const override;
516 QString encodedSource(
const QString &source,
const QgsReadWriteContext &context )
const override;
517 QString decodedSource(
const QString &source,
const QString &provider,
const QgsReadWriteContext &context )
const override;
523 void closeDataProvider();
535 bool generateLookupTableFlag,
538 void computeMinMax(
int band,
543 double &min,
double &max );
546 const QString QSTRING_NOT_SET;
547 const QString TRSTRING_NOT_SET;
553 QDateTime mLastModified;
562 QgsRectangle mLastRectangleUsedByRefreshContrastEnhancementIfNeeded;
564 QDomDocument mOriginalStyleDocument;
565 QDomElement mOriginalStyleElement;
The class is used as a container of context for various read/write operations on other objects...
A rectangle specified with double values.
Base class for all map layer types.
LayerOptions(bool loadDefaultStyle=true, const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions.
Base class for processing modules.
static const QgsContrastEnhancement::ContrastEnhancementAlgorithm MULTIPLE_BAND_MULTI_BYTE_ENHANCEMENT_ALGORITHM
Default enhancement algorithm for multiple band raster of type different from Byte.
QgsHueSaturationFilter * hueSaturationFilter() const
Returns the raster's hue/saturation filter.
DrawingStyle
This enumerator describes the different kinds of drawing we can do.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
QgsRasterPipe * pipe()
Returns the raster pipe.
Resample filter pipe for rasters.
QgsRasterRenderer * renderer() const
Returns the raster's renderer.
static const double SAMPLE_SIZE
Default sample size (number of pixels) for estimated statistics/histogram calculation.
An interface for classes which can visit style entity (e.g.
QMap< QString, QString > QgsStringMap
QgsBrightnessContrastFilter * brightnessFilter() const
Returns the raster's brightness/contrast filter.
ColorShadingAlgorithm
This enumerator describes the types of shading that can be used.
static const QgsRasterMinMaxOrigin::Limits MULTIPLE_BAND_SINGLE_BYTE_MIN_MAX_LIMITS
Default enhancement limits for multiple band raster of type Byte.
Perform transforms between map coordinates and device coordinates.
This class describes the origin of min/max values.
static const QgsContrastEnhancement::ContrastEnhancementAlgorithm SINGLE_BAND_ENHANCEMENT_ALGORITHM
Default enhancement algorithm for single band raster.
LayerType rasterType()
Returns the raster layer type (which is a read only property).
Contains information about the context in which a coordinate transform is executed.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
static const QgsRasterMinMaxOrigin::Limits SINGLE_BAND_MIN_MAX_LIMITS
Default enhancement limits for single band raster.
Limits
This enumerator describes the limits used to compute min/max values.
QList< QPair< QString, QColor > > QgsLegendColorList
ContrastEnhancementAlgorithm
This enumerator describes the types of contrast enhancement algorithms that can be used...
Contains information about the context of a rendering operation.
Setting options for creating vector data providers.
QgsRasterResampleFilter * resampleFilter() const
Returns the raster's resample filter.
Brightness/contrast filter pipe for rasters.
Color and saturation filter pipe for rasters.
bool isSpatial() const override
Returns true if the layer is considered a spatial layer, ie it has some form of geometry associated w...
Base class for utility classes that encapsulate information necessary for rendering of map layers...
This class provides details of the viewable area that a raster will be rendered into.
LayerType
This enumerator describes the type of raster layer.
Raster renderer pipe that applies colors to a raster.
static const QgsContrastEnhancement::ContrastEnhancementAlgorithm MULTIPLE_BAND_SINGLE_BYTE_ENHANCEMENT_ALGORITHM
Default enhancement algorithm for multiple band raster of type Byte.
Setting options for loading raster layers.
static const QgsRasterMinMaxOrigin::Limits MULTIPLE_BAND_MULTI_BYTE_MIN_MAX_LIMITS
Default enhancement limits for multiple band raster of type different from Byte.
Base class for raster data providers.