18#ifndef QGSRASTERTRANSPARENCY_H
19#define QGSRASTERTRANSPARENCY_H
96 return !( *
this == other );
100 SIP_PYOBJECT __repr__();
102 const QString
str = QStringLiteral(
"<QgsRasterTransparency.TransparentThreeValuePixel: %1, %2, %3, %4>" ).arg( sipCpp->red ).arg( sipCpp->green ).arg( sipCpp->blue ).arg( sipCpp->opacity );
103 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
129 , includeMinimum( includeMinimum )
130 , includeMaximum( includeMaximum )
156 bool includeMinimum =
true;
164 bool includeMaximum =
true;
175 return !( *
this == other );
179 SIP_PYOBJECT __repr__();
181 const QString
str = QStringLiteral(
"<QgsRasterTransparency.TransparentSingleValuePixel: %1, %2, %3>" ).arg( sipCpp->min ).arg( sipCpp->max ).arg( sipCpp->opacity );
182 sipRes = PyUnicode_FromString(
str.toUtf8().constData() );
191 QVector<QgsRasterTransparency::TransparentSingleValuePixel> transparentSingleValuePixelList()
const;
197 QVector<QgsRasterTransparency::TransparentThreeValuePixel> transparentThreeValuePixelList()
const;
202 void initializeTransparentPixelList(
double value );
207 void initializeTransparentPixelList(
double redValue,
double greenValue,
double blueValue );
213 void setTransparentSingleValuePixelList(
const QVector<QgsRasterTransparency::TransparentSingleValuePixel> &newList );
219 void setTransparentThreeValuePixelList(
const QVector<QgsRasterTransparency::TransparentThreeValuePixel> &newList );
232 Q_DECL_DEPRECATED
int alphaValue(
double value,
int globalTransparency = 255 ) const
SIP_DEPRECATED;
242 double opacityForValue(
double value ) const;
256 Q_DECL_DEPRECATED
int alphaValue(
double redValue,
double greenValue,
double blueValue,
int globalTransparency = 255 ) const
SIP_DEPRECATED;
268 double opacityForRgbValues(
double redValue,
double greenValue,
double blueValue ) const;
271 bool isEmpty() const;
276 void writeXml( QDomDocument &doc, QDomElement &parentElem ) const;
281 void readXml( const QDomElement &elem );
Defines the list of pixel values to be considered as transparent or semi transparent when rendering r...
QgsRasterTransparency()=default
Constructor for QgsRasterTransparency.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Defines the transparency for a range of single-band pixel values.
bool operator==(const QgsRasterTransparency::TransparentSingleValuePixel &other) const
TransparentSingleValuePixel(double minimum=0, double maximum=0, double opacity=0, bool includeMinimum=true, bool includeMaximum=true)
Constructor for TransparentSingleValuePixel.
double opacity
Opacity for pixel, between 0 and 1.0.
double min
Minimum pixel value to include in range.
double max
Maximum pixel value to include in range.
bool includeMaximum
true if pixels matching the max value should be considered transparent, or false if only pixels less ...
bool operator!=(const QgsRasterTransparency::TransparentSingleValuePixel &other) const
bool includeMinimum
true if pixels matching the min value should be considered transparent, or false if only pixels great...
Defines the transparency for a RGB pixel value.
bool operator!=(const QgsRasterTransparency::TransparentThreeValuePixel &other) const
double opacity
Opacity for pixel, between 0 and 1.0.
double red
Red pixel value.
TransparentThreeValuePixel(double red=0, double green=0, double blue=0, double opacity=0)
Constructor for TransparentThreeValuePixel.
double green
Green pixel value.
bool operator==(const QgsRasterTransparency::TransparentThreeValuePixel &other) const
double blue
Blue pixel value.