1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasterrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsRasterRenderer : QgsRasterInterface
{
%Docstring(signature="appended")
Raster renderer pipe that applies colors to a raster.
%End
%TypeHeaderCode
#include "qgsrasterrenderer.h"
%End
public:
static const QRgb NODATA_COLOR;
QgsRasterRenderer( QgsRasterInterface *input = 0, const QString &type = QString() );
%Docstring
Constructor for QgsRasterRenderer.
%End
~QgsRasterRenderer();
virtual QgsRasterRenderer *clone() const = 0 /Factory/;
virtual int bandCount() const;
virtual Qgis::DataType dataType( int bandNo ) const;
virtual QString type() const;
%Docstring
Returns a unique string representation of the renderer type.
%End
virtual Qgis::RasterRendererFlags flags() const;
%Docstring
Returns flags which dictate renderer behavior.
.. versionadded:: 3.28
%End
virtual bool canCreateRasterAttributeTable( ) const;
%Docstring
Returns ``True`` if the renderer is suitable for attribute table
creation. The default implementation returns ``False``.
.. versionadded:: 3.30
%End
virtual bool setInput( QgsRasterInterface *input );
virtual int inputBand() const;
%Docstring
Returns the input band for the renderer, or -1 if no input band is
available.
For renderers which utilize multiple input bands -1 will be returned. In
these cases :py:func:`~QgsRasterRenderer.usesBands` will return a list
of all utilized bands (including alpha bands).
.. seealso:: :py:func:`setInputBand`
.. seealso:: :py:func:`usesBands`
.. versionadded:: 3.38
%End
virtual bool setInputBand( int band );
%Docstring
Attempts to set the input ``band`` for the renderer.
Returns ``True`` if the band was successfully set, or ``False`` if the
band could not be set.
.. note::
Not all renderers support setting the input band.
.. seealso:: :py:func:`inputBand`
.. seealso:: :py:func:`usesBands`
.. versionadded:: 3.38
%End
virtual QgsRasterBlock *block( int bandNo,
const QgsRectangle &extent,
int width,
int height,
QgsRasterBlockFeedback *feedback = 0 ) = 0 /Factory/;
bool usesTransparency() const;
void setOpacity( double opacity );
%Docstring
Sets the ``opacity`` for the renderer, where ``opacity`` is a value
between 0 (totally transparent) and 1.0 (fully opaque).
.. seealso:: :py:func:`opacity`
%End
double opacity() const;
%Docstring
Returns the opacity for the renderer, where opacity is a value between 0
(totally transparent) and 1.0 (fully opaque).
.. seealso:: :py:func:`setOpacity`
%End
QColor nodataColor() const;
%Docstring
Returns the color to use for shading nodata pixels.
If the returned value is an invalid color then the default transparent
rendering of nodata values will be used.
.. seealso:: :py:func:`renderColorForNodataPixel`
.. seealso:: :py:func:`setNodataColor`
.. versionadded:: 3.12
%End
void setNodataColor( const QColor &color );
%Docstring
Sets the ``color`` to use for shading nodata pixels.
If ``color`` is an invalid color then the default transparent rendering
of nodata values will be used.
.. seealso:: :py:func:`nodataColor`
.. versionadded:: 3.12
%End
void setRasterTransparency( QgsRasterTransparency *t /Transfer/ );
const QgsRasterTransparency *rasterTransparency() const;
void setAlphaBand( int band );
int alphaBand() const;
virtual QList< QPair< QString, QColor > > legendSymbologyItems() const;
%Docstring
Returns symbology items if provided by renderer.
.. seealso:: :py:func:`createLegendNodes`
%End
virtual QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
%Docstring
Creates a set of legend nodes representing the renderer.
The default implementation calls
:py:func:`~QgsRasterRenderer.legendSymbologyItems` and creates
corresponding legend nodes for each returned symbology item.
Subclasses can override this to return more legend nodes which better
represent the renderer.
.. versionadded:: 3.18
%End
virtual void readXml( const QDomElement &rendererElem );
%Docstring
Sets base class members from xml. Usually called from
:py:func:`~QgsRasterRenderer.create` methods of subclasses
%End
void copyCommonProperties( const QgsRasterRenderer *other, bool copyMinMaxOrigin = true );
%Docstring
Copies common properties like opacity / transparency data from other
renderer. Useful when cloning renderers.
%End
virtual QList<int> usesBands() const;
%Docstring
Returns a list of band numbers used by the renderer.
.. seealso:: :py:func:`setInputBand`
%End
const QgsRasterMinMaxOrigin &minMaxOrigin() const;
%Docstring
Returns const reference to origin of min/max values
%End
void setMinMaxOrigin( const QgsRasterMinMaxOrigin &origin );
%Docstring
Sets origin of min/max values
%End
virtual void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const;
%Docstring
Used from subclasses to create SLD Rule elements following SLD v1.0
specs
.. versionadded:: 3.6
%End
virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
%Docstring
Accepts the specified symbology ``visitor``, causing it to visit all
symbols associated with the renderer.
Returns ``True`` if the visitor should continue visiting other objects,
or ``False`` if visiting should be canceled.
.. versionadded:: 3.10
%End
protected:
void _writeXml( QDomDocument &doc, QDomElement &rasterRendererElem ) const;
%Docstring
Write upper class info into rasterrenderer element (called by writeXml
method of subclasses)
%End
QRgb renderColorForNodataPixel() const;
%Docstring
Returns the color for the renderer to use to represent nodata pixels.
Subclasses should use this rather then
:py:func:`~QgsRasterRenderer.nodataColor` to determine the color to use
for nodata pixels during an actual rendering operation.
.. versionadded:: 3.10
%End
private:
QgsRasterRenderer( const QgsRasterRenderer & );
const QgsRasterRenderer &operator=( const QgsRasterRenderer & );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrasterrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|