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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgspalettedrasterrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsPalettedRasterRenderer: QgsRasterRenderer
{
%Docstring(signature="appended")
Renderer for paletted raster images.
%End
%TypeHeaderCode
#include "qgspalettedrasterrenderer.h"
%End
public:
struct Class
{
Class( double value, const QColor &color = QColor(), const QString &label = QString() );
%Docstring
Constructor for Class
%End
double value;
QColor color;
QString label;
};
class MultiValueClass
{
%Docstring(signature="appended")
Properties of a multi value class: a class that contains multiple
values.
.. versionadded:: 3.30
%End
%TypeHeaderCode
#include "qgspalettedrasterrenderer.h"
%End
public:
MultiValueClass( const QVector< QVariant > &values, const QColor &color = QColor(), const QString &label = QString() );
%Docstring
Constructor for MultiValueClass from a list of values
%End
QVector< QVariant > values;
QColor color;
QString label;
};
typedef QList< QgsPalettedRasterRenderer::Class > ClassData;
typedef QList< QgsPalettedRasterRenderer::MultiValueClass > MultiValueClassData;
QgsPalettedRasterRenderer( QgsRasterInterface *input, int bandNumber, const ClassData &classes );
%Docstring
Constructor for QgsPalettedRasterRenderer.
%End
virtual QgsPalettedRasterRenderer *clone() const /Factory/;
virtual Qgis::RasterRendererFlags flags() const;
static QgsRasterRenderer *create( const QDomElement &elem, QgsRasterInterface *input ) /Factory/;
virtual QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height, QgsRasterBlockFeedback *feedback = 0 ) /Factory/;
int nColors() const;
%Docstring
Returns number of colors
%End
ClassData classes() const;
%Docstring
Returns a map of value to classes (colors) used by the renderer.
%End
MultiValueClassData multiValueClasses( ) const;
%Docstring
Returns a map of multi value to classes (colors) used by the renderer.
.. versionadded:: 3.30
%End
virtual bool canCreateRasterAttributeTable( ) const;
void setMultiValueClasses( const MultiValueClassData &classes );
%Docstring
Sets the multi value classes to ``setMultiValueClasses``.
.. versionadded:: 3.30
%End
QString label( double idx ) const;
%Docstring
Returns optional category label
%End
void setLabel( double idx, const QString &label );
%Docstring
Set category label
%End
int band() const /Deprecated/;
%Docstring
Returns the raster band used for rendering the raster.
.. deprecated:: 3.38
Use :py:func:`~QgsPalettedRasterRenderer.inputBand` instead.
%End
virtual int inputBand() const;
virtual bool setInputBand( int band );
virtual void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
virtual QList< QPair< QString, QColor > > legendSymbologyItems() const;
virtual QList<QgsLayerTreeModelLegendNode *> createLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
virtual QList<int> usesBands() const;
virtual void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const;
virtual bool accept( QgsStyleEntityVisitorInterface *visitor ) const;
void setSourceColorRamp( QgsColorRamp *ramp /Transfer/ );
%Docstring
Set the source color ``ramp``. Ownership is transferred to the renderer.
.. seealso:: :py:func:`sourceColorRamp`
%End
QgsColorRamp *sourceColorRamp() const;
%Docstring
Gets the source color ramp
.. seealso:: :py:func:`setSourceColorRamp`
%End
static QgsPalettedRasterRenderer::ClassData colorTableToClassData( const QList<QgsColorRampShader::ColorRampItem> &table );
%Docstring
Converts a raster color ``table`` to paletted renderer class data.
%End
static QgsPalettedRasterRenderer::MultiValueClassData rasterAttributeTableToClassData( const QgsRasterAttributeTable *attributeTable, int classificationColumn = -1, QgsColorRamp *ramp = 0 );
%Docstring
Reads and returns classes from the Raster Attribute Table
``attributeTable``, optionally classifying the attribute table by
``classificationColumn`` and setting the colors from ``ramp``. The
default value of -1 for the classificationColumn uses the first
available value column.
.. note::
The method will return an empty list of classes in case the Raster Attribute Table is not thematic.
.. versionadded:: 3.30
%End
static QgsPalettedRasterRenderer::ClassData classDataFromString( const QString &string );
%Docstring
Converts a ``string`` containing a color table or class data to to
paletted renderer class data.
.. seealso:: :py:func:`classDataFromFile`
.. seealso:: :py:func:`classDataToString`
%End
static QgsPalettedRasterRenderer::ClassData classDataFromFile( const QString &path );
%Docstring
Opens a color table file and returns corresponding paletted renderer
class data.
.. seealso:: :py:func:`classDataFromString`
%End
static QString classDataToString( const QgsPalettedRasterRenderer::ClassData &classes );
%Docstring
Converts classes to a string representation, using the .clr/gdal color
table file format.
.. seealso:: :py:func:`classDataFromString`
%End
static QgsPalettedRasterRenderer::ClassData classDataFromRaster( QgsRasterInterface *raster, int bandNumber, QgsColorRamp *ramp = 0,
QgsRasterBlockFeedback *feedback = 0 );
%Docstring
Generates class data from a ``raster``, for the specified
``bandNumber``. An optional color ``ramp`` can be specified to
automatically assign colors from the ramp.
%End
private:
QgsPalettedRasterRenderer( const QgsPalettedRasterRenderer & );
const QgsPalettedRasterRenderer &operator=( const QgsPalettedRasterRenderer & );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgspalettedrasterrenderer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|