Raster API opacity documentation

This commit is contained in:
Nyall Dawson 2017-05-30 08:48:14 +10:00
parent 32480fe8bd
commit 233a95e99b
2 changed files with 14 additions and 2 deletions

View File

@ -29,7 +29,8 @@ const QRgb QgsRasterRenderer::NODATA_COLOR = qRgba( 0, 0, 0, 0 );
QgsRasterRenderer::QgsRasterRenderer( QgsRasterInterface *input, const QString &type )
: QgsRasterInterface( input )
, mType( type ), mOpacity( 1.0 ), mRasterTransparency( nullptr )
, mType( type )
, mRasterTransparency( nullptr )
, mAlphaBand( -1 ) //, mInvertColor( false )
{
}

View File

@ -64,7 +64,18 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
bool usesTransparency() const;
/**
* Sets the \a opacity for the renderer, where \a opacity is a value between 0 (totally transparent)
* and 1.0 (fully opaque).
* \see opacity()
*/
void setOpacity( double opacity ) { mOpacity = opacity; }
/**
* Returns the opacity for the renderer, where opacity is a value between 0 (totally transparent)
* and 1.0 (fully opaque).
* \see setOpacity()
*/
double opacity() const { return mOpacity; }
void setRasterTransparency( QgsRasterTransparency *t );
@ -101,7 +112,7 @@ class CORE_EXPORT QgsRasterRenderer : public QgsRasterInterface
QString mType;
//! Global alpha value (0-1)
double mOpacity;
double mOpacity = 1.0;
//! Raster transparency per color or value. Overwrites global alpha value
QgsRasterTransparency *mRasterTransparency = nullptr;