mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-03 00:02:25 -05:00
This commit implements the improvements described at: https://lists.osgeo.org/pipermail/qgis-developer/2016-September/044393.html The QgsRasterMinMaxWidget now offers a seetting to specify that the statistics should be computed each time the canvas extent changes. Other changes: - the content of the QgsRasterMinMaxWidget is now persistant. - there is no longer any Load button. The global Apply / OK button of the raster properties dialog has this effect. - the default "limits" for single band raster is now MinMax and not CumulativeCut - the default "limits" can be configured for single band, multi band single byte and multi band multi byte - "Strech using current extent" honours the "limits" instead of forcing min/max.
69 lines
2.1 KiB
Plaintext
69 lines
2.1 KiB
Plaintext
|
|
class QgsRasterRenderer : QgsRasterInterface
|
|
{
|
|
%TypeHeaderCode
|
|
#include "qgsrasterrenderer.h"
|
|
%End
|
|
|
|
public:
|
|
|
|
static const QRgb NODATA_COLOR;
|
|
|
|
QgsRasterRenderer( QgsRasterInterface* input = 0, const QString& type = "" );
|
|
virtual ~QgsRasterRenderer();
|
|
|
|
virtual QgsRasterRenderer * clone() const = 0 /Factory/;
|
|
|
|
virtual int bandCount() const;
|
|
|
|
virtual Qgis::DataType dataType( int bandNo ) const;
|
|
|
|
virtual QString type() const;
|
|
|
|
virtual bool setInput( QgsRasterInterface* input );
|
|
|
|
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) = 0 / Factory /;
|
|
|
|
bool usesTransparency() const;
|
|
|
|
void setOpacity( double opacity );
|
|
double opacity() const;
|
|
|
|
void setRasterTransparency( QgsRasterTransparency* t /Transfer/);
|
|
const QgsRasterTransparency* rasterTransparency() const;
|
|
|
|
void setAlphaBand( int band );
|
|
int alphaBand() const;
|
|
|
|
/** Get symbology items if provided by renderer*/
|
|
virtual void legendSymbologyItems( QList< QPair< QString, QColor > >& symbolItems ) const;
|
|
|
|
/** Sets base class members from xml. Usually called from create() methods of subclasses*/
|
|
void readXml( const QDomElement& rendererElem );
|
|
|
|
/** Copies common properties like opacity / transparency data from other renderer.
|
|
* Useful when cloning renderers.
|
|
* @note added in 2.16 */
|
|
void copyCommonProperties( const QgsRasterRenderer* other, bool copyMinMaxOrigin = true );
|
|
|
|
/** Returns a list of band numbers used by the renderer*/
|
|
virtual QList<int> usesBands() const;
|
|
|
|
//! Returns const reference to origin of min/max values
|
|
const QgsRasterMinMaxOrigin& minMaxOrigin() const;
|
|
|
|
//! Sets origin of min/max values
|
|
void setMinMaxOrigin( const QgsRasterMinMaxOrigin& theOrigin );
|
|
|
|
protected:
|
|
|
|
/** Write upper class info into rasterrenderer element (called by writeXML method of subclasses)*/
|
|
void _writeXml( QDomDocument& doc, QDomElement& rasterRendererElem ) const;
|
|
|
|
private:
|
|
|
|
QgsRasterRenderer( const QgsRasterRenderer& );
|
|
const QgsRasterRenderer& operator=( const QgsRasterRenderer& );
|
|
|
|
};
|