QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
21 #ifndef QGSCOLORRAMPSHADER_H
22 #define QGSCOLORRAMPSHADER_H
24 #include "qgis_core.h"
90 ColorRampItem(
double val,
const QColor &col,
const QString &lbl = QString() )
105 QList<QgsColorRampShader::ColorRampItem>
colorRampItemList()
const {
return mColorRampItemList.toList(); }
111 QString colorRampTypeAsQString()
const;
114 void setColorRampItemList(
const QList<QgsColorRampShader::ColorRampItem> &list );
123 bool isEmpty()
const;
141 void setColorRampType(
const QString &type );
161 bool shade(
double value,
int *returnRedValue
SIP_OUT,
int *returnGreenValue
SIP_OUT,
int *returnBlueValue
SIP_OUT,
int *returnAlphaValue
SIP_OUT ) const override;
164 bool shade(
double redValue,
double greenValue,
165 double blueValue,
double alphaValue,
167 int *returnBlueValue
SIP_OUT,
int *returnAlphaValue
SIP_OUT ) const override;
169 void legendSymbologyItems( QList< QPair< QString, QColor > > &symbolItems
SIP_OUT ) const override;
175 QDomElement writeXml( QDomDocument &doc ) const;
181 void readXml( const QDomElement &elem );
184 void setClassificationMode(
ClassificationMode classificationMode ) { mClassificationMode = classificationMode; }
200 bool clip()
const {
return mClip; }
216 QVector<QgsColorRampShader::ColorRampItem> mColorRampItemList;
225 mutable QVector<int> mLUT;
226 mutable double mLUTOffset = 0.0;
227 mutable double mLUTFactor = 1.0;
228 mutable bool mLUTInitialized =
false;
Abstract base class for color ramps.
A ramp shader will color a raster pixel based on a list of values ranges in a ramp.
Type
Supported methods for color interpolation.
A rectangle specified with double values.
@ Discrete
Assigns the color of the higher class for every pixel between two class breaks.
void setClip(bool clip)
Sets whether the shader should not render values out of range.
ColorRampItem()=default
default constructor
ColorRampItem(double val, const QColor &col, const QString &lbl=QString())
convenience constructor
QList< QgsColorRampShader::ColorRampItem > colorRampItemList() const
Returns the custom colormap.
Type colorRampType() const
Returns the color ramp type.
ClassificationMode
Classification modes used to create the color ramp shader.
Base class for processing filters like renderers, reprojector, resampler etc.
bool operator<(const QgsColorRampShader::ColorRampItem &other) const
bool clip() const
Returns whether the shader will clip values which are out of range.
The raster shade function applies a shader to a pixel at render time - typically used to render grays...
std::unique_ptr< QgsColorRamp > mSourceColorRamp
Source color ramp.
ClassificationMode classificationMode() const
Returns the classification mode.
@ Interpolated
Interpolates the color between two class breaks linearly.