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
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrastertransparency.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsRasterTransparency
{
%Docstring(signature="appended")
Defines the list of pixel values to be considered as transparent or semi
transparent when rendering rasters.
%End
%TypeHeaderCode
#include "qgsrastertransparency.h"
%End
public:
QgsRasterTransparency();
struct TransparentThreeValuePixel
{
TransparentThreeValuePixel( double red = 0, double green = 0, double blue = 0, double opacity = 0, double fuzzyToleranceRed = 4 * DBL_EPSILON, double fuzzyToleranceGreen = 4 * DBL_EPSILON, double fuzzyToleranceBlue = 4 * DBL_EPSILON );
%Docstring
Constructor for TransparentThreeValuePixel.
:param red: red pixel value
:param green: green pixel value
:param blue: blue pixel value
:param opacity: opacity for pixel, between 0 and 1.0
:param fuzzyToleranceRed: (since QGIS 3.40) allows specifying a
tolerance for the red color component, where
the pixel's red component can deviate from
values specified here by a maximum of this
tolerance amount
:param fuzzyToleranceGreen: (since QGIS 3.40) allows specifying a
tolerance for the green color component,
where the pixel's green component can
deviate from values specified here by a
maximum of this tolerance amount
:param fuzzyToleranceBlue: (since QGIS 3.40) allows specifying a
tolerance for the blue color component, where
the pixel's blue component can deviate from
values specified here by a maximum of this
tolerance amount
.. versionadded:: 3.38
%End
double red;
double green;
double blue;
double opacity;
double fuzzyToleranceRed;
double fuzzyToleranceGreen;
double fuzzyToleranceBlue;
bool operator==( const QgsRasterTransparency::TransparentThreeValuePixel &other ) const;
bool operator!=( const QgsRasterTransparency::TransparentThreeValuePixel &other ) const;
SIP_PYOBJECT __repr__();
%MethodCode
QString str;
if ( !qgsDoubleNear( sipCpp->fuzzyToleranceRed, 0 ) || !qgsDoubleNear( sipCpp->fuzzyToleranceGreen, 0 ) || !qgsDoubleNear( sipCpp->fuzzyToleranceBlue, 0 ) )
str = QStringLiteral( "<QgsRasterTransparency.TransparentThreeValuePixel: %1, %2, %3, %4, %5, %6, %7>" ).arg( sipCpp->red ).arg( sipCpp->green ).arg( sipCpp->blue ).arg( sipCpp->opacity ).arg( sipCpp->fuzzyToleranceRed ).arg( sipCpp->fuzzyToleranceGreen ).arg( sipCpp->fuzzyToleranceBlue );
else
str = QStringLiteral( "<QgsRasterTransparency.TransparentThreeValuePixel: %1, %2, %3, %4>" ).arg( sipCpp->red ).arg( sipCpp->green ).arg( sipCpp->blue ).arg( sipCpp->opacity );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
};
struct TransparentSingleValuePixel
{
TransparentSingleValuePixel( double minimum = 0, double maximum = 0, double opacity = 0, bool includeMinimum = true, bool includeMaximum = true );
%Docstring
Constructor for TransparentSingleValuePixel.
:param minimum: minimum pixel value to include in range
:param maximum: maximum pixel value to include in range
:param opacity: opacity for pixel, between 0 and 1.0
:param includeMinimum: whether the minimum value should be included in
the range
:param includeMaximum: whether the maximum value should be included in
the range
.. versionadded:: 3.38
%End
double min;
double max;
double opacity;
bool includeMinimum;
bool includeMaximum;
bool operator==( const QgsRasterTransparency::TransparentSingleValuePixel &other ) const;
bool operator!=( const QgsRasterTransparency::TransparentSingleValuePixel &other ) const;
SIP_PYOBJECT __repr__();
%MethodCode
const QString str = QStringLiteral( "<QgsRasterTransparency.TransparentSingleValuePixel: %1, %2, %3>" ).arg( sipCpp->min ).arg( sipCpp->max ).arg( sipCpp->opacity );
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
%End
};
QVector<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList() const;
%Docstring
Returns the transparent single value pixel list.
.. seealso:: :py:func:`setTransparentSingleValuePixelList`
%End
QVector<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList() const;
%Docstring
Returns the transparent three value pixel list.
.. seealso:: :py:func:`setTransparentThreeValuePixelList`
%End
void initializeTransparentPixelList( double value );
%Docstring
Resets the transparency list to a single ``value``.
%End
void initializeTransparentPixelList( double redValue, double greenValue, double blueValue );
%Docstring
Resets the transparency list to single red, green, and blue values.
%End
void setTransparentSingleValuePixelList( const QVector<QgsRasterTransparency::TransparentSingleValuePixel> &newList );
%Docstring
Sets the transparent single value pixel list, replacing the whole
existing list.
.. seealso:: :py:func:`transparentSingleValuePixelList`
%End
void setTransparentThreeValuePixelList( const QVector<QgsRasterTransparency::TransparentThreeValuePixel> &newList );
%Docstring
Sets the transparent three value pixel list, replacing the whole
existing list.
.. seealso:: :py:func:`transparentThreeValuePixelList`
%End
int alphaValue( double value, int globalTransparency = 255 ) const /Deprecated/;
%Docstring
Returns the transparency value for a single ``value`` pixel.
Searches through the transparency list, and if a match is found, the
global transparency value is scaled by the stored transparency value.
:param value: the needle to search for in the transparency hay stack
:param globalTransparency: the overall transparency level for the layer
.. deprecated:: 3.40
Use :py:func:`~QgsRasterTransparency.opacityForValue` instead.
%End
double opacityForValue( double value ) const;
%Docstring
Returns the opacity (as a value from 0 to 1) for a single ``value``
pixel.
Searches through the transparency list, and if a match is found, returns
the opacity corresponding to the value. Returns 1 if no matches are
found.
.. versionadded:: 3.38
%End
int alphaValue( double redValue, double greenValue, double blueValue, int globalTransparency = 255 ) const /Deprecated/;
%Docstring
Returns the transparency value for a RGB pixel.
Searches through the transparency list, if a match is found, the global
transparency value is scaled by the stored transparency value.
:param redValue: the red portion of the needle to search for in the
transparency hay stack
:param greenValue: the green portion of the needle to search for in the
transparency hay stack
:param blueValue: the green portion of the needle to search for in the
transparency hay stack
:param globalTransparency: the overall transparency level for the layer
.. deprecated:: 3.40
Use :py:func:`~QgsRasterTransparency.opacityForRgbValues` instead.
%End
double opacityForRgbValues( double redValue, double greenValue, double blueValue ) const;
%Docstring
Returns the opacity (as a value from 0 to 1) for a set of RGB pixel
values.
Searches through the transparency list, and if a match is found, returns
the opacity corresponding to the values. Returns 1 if no matches are
found.
If any of the red, green or blue values are NaN, 0 will be returned.
.. versionadded:: 3.38
%End
bool isEmpty() const;
%Docstring
True if there are no entries in the pixel lists except the nodata value
%End
void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
%Docstring
Writes the transparency information to an XML document.
%End
void readXml( const QDomElement &elem );
%Docstring
Reads the transparency information from an XML document.
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/raster/qgsrastertransparency.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|