21 #ifndef QGSCOLORRAMPSHADER_H
22 #define QGSCOLORRAMPSHADER_H
24 #include "qgis_core.h"
88 if ( mColorRampItemList.count() != other.mColorRampItemList.count() ||
89 mClassificationMode != other.mClassificationMode ||
90 mColorRampType != other.mColorRampType )
94 for (
int i = 0; i < mColorRampItemList.count(); ++i )
96 if ( mColorRampItemList.at( i ) != other.mColorRampItemList.at( i ) )
return false;
110 ColorRampItem(
double val,
const QColor &col,
const QString &lbl = QString() )
125 return ( color != other.
color ) ||
126 ( !std::isnan( value ) && !std::isnan( other.
value ) && value != other.
value ) ||
127 ( std::isnan( value ) != std::isnan( other.
value ) );
132 QList<QgsColorRampShader::ColorRampItem>
colorRampItemList()
const {
return mColorRampItemList.toList(); }
138 QString colorRampTypeAsQString()
const;
141 void setColorRampItemList(
const QList<QgsColorRampShader::ColorRampItem> &list );
150 bool isEmpty()
const;
173 void setColorRampType( const QString &type );
193 bool shade(
double value,
int *returnRedValue
SIP_OUT,
int *returnGreenValue
SIP_OUT,
int *returnBlueValue
SIP_OUT,
int *returnAlphaValue
SIP_OUT ) const override;
196 bool shade(
double redValue,
double greenValue,
197 double blueValue,
double alphaValue,
199 int *returnBlueValue
SIP_OUT,
int *returnAlphaValue
SIP_OUT ) const override;
201 void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems
SIP_OUT ) const override;
216 void setClassificationMode(
ClassificationMode classificationMode ) { mClassificationMode = classificationMode; }
232 bool clip()
const {
return mClip; }
266 QVector<QgsColorRampShader::ColorRampItem> mColorRampItemList;
275 mutable std::vector<int> mLUT;
276 mutable double mLUTOffset = 0.0;
277 mutable double mLUTFactor = 1.0;
278 mutable bool mLUTInitialized =
false;
283 std::unique_ptr< QgsColorRampLegendNodeSettings > mLegendSettings;