QGIS API Documentation 3.32.0-Lima (311a8cb8a6)
|
#include <qgscolorrampimpl.h>
Public Member Functions | |
QgsCptCityColorRamp (const QString &schemeName, const QStringList &variantList, const QString &variantName=QString(), bool inverted=false, bool doLoadFile=true) | |
Constructor for QgsCptCityColorRamp. More... | |
QgsCptCityColorRamp (const QString &schemeName=DEFAULT_CPTCITY_SCHEMENAME, const QString &variantName=DEFAULT_CPTCITY_VARIANTNAME, bool inverted=false, bool doLoadFile=true) | |
Constructor for QgsCptCityColorRamp. More... | |
QgsCptCityColorRamp * | clone () const override |
Creates a clone of the color ramp. More... | |
QgsGradientColorRamp * | cloneGradientRamp () const |
void | copy (const QgsCptCityColorRamp *other) |
QString | copyingFileName () const |
QgsStringMap | copyingInfo () const |
QString | descFileName () const |
bool | fileLoaded () const |
QString | fileName () const |
bool | hasMultiStops () const |
void | invert () override |
Inverts the ordering of the color ramp. More... | |
bool | loadFile () |
void | loadPalette () |
QVariantMap | properties () const override |
Returns a string map containing all the color ramp's properties. More... | |
QString | schemeName () const |
void | setName (const QString &schemeName, const QString &variantName=QString(), const QStringList &variantList=QStringList()) |
void | setSchemeName (const QString &schemeName) |
void | setVariantList (const QStringList &variantList) |
void | setVariantName (const QString &variantName) |
QString | type () const override |
Returns a string representing the color ramp type. More... | |
QStringList | variantList () const |
QString | variantName () const |
![]() | |
QgsGradientColorRamp (const QColor &color1=DEFAULT_GRADIENT_COLOR1, const QColor &color2=DEFAULT_GRADIENT_COLOR2, bool discrete=false, const QgsGradientStopsList &stops=QgsGradientStopsList()) | |
Constructor for QgsGradientColorRamp. More... | |
void | addStopsToGradient (QGradient *gradient, double opacity=1) const |
Copy color ramp stops to a QGradient. More... | |
QgsGradientColorRamp * | clone () const override |
Creates a clone of the color ramp. More... | |
QColor | color (double value) const override |
Returns the color corresponding to a specified value. More... | |
QColor | color1 () const |
Returns the gradient start color. More... | |
QColor | color2 () const |
Returns the gradient end color. More... | |
QColor::Spec | colorSpec () const |
Returns the color specification in which the color component interpolation will occur. More... | |
void | convertToDiscrete (bool discrete) |
Converts a gradient with existing color stops to or from discrete interpolation. More... | |
int | count () const override |
Returns number of defined colors, or -1 if undefined. More... | |
Qgis::AngularDirection | direction () const |
Returns the direction to traverse the color wheel using when interpolating hue-based color specifications. More... | |
QgsStringMap | info () const |
Returns any additional info attached to the gradient ramp (e.g., authorship notes) More... | |
void | invert () override |
Inverts the ordering of the color ramp. More... | |
bool | isDiscrete () const |
Returns true if the gradient is using discrete interpolation, rather than smoothly interpolating between colors. More... | |
QVariantMap | properties () const override |
Returns a string map containing all the color ramp's properties. More... | |
void | setColor1 (const QColor &color) |
Sets the gradient start color. More... | |
void | setColor2 (const QColor &color) |
Sets the gradient end color. More... | |
void | setColorSpec (QColor::Spec spec) |
Sets the color specification in which the color component interpolation will occur. More... | |
void | setDirection (Qgis::AngularDirection direction) |
Sets the direction to traverse the color wheel using when interpolating hue-based color specifications. More... | |
void | setDiscrete (bool discrete) |
Sets whether the gradient should use discrete interpolation, rather than smoothly interpolating between colors. More... | |
void | setInfo (const QgsStringMap &info) |
Sets additional info to attach to the gradient ramp (e.g., authorship notes) More... | |
void | setStops (const QgsGradientStopsList &stops) |
Sets the list of intermediate gradient stops for the ramp. More... | |
QgsGradientStopsList | stops () const |
Returns the list of intermediate gradient stops for the ramp. More... | |
QString | type () const override |
Returns a string representing the color ramp type. More... | |
double | value (int index) const override |
Returns relative value between [0,1] of color at specified index. More... | |
![]() | |
virtual | ~QgsColorRamp () |
virtual QgsColorRamp * | clone () const =0 |
Creates a clone of the color ramp. More... | |
virtual QColor | color (double value) const =0 |
Returns the color corresponding to a specified value. More... | |
virtual int | count () const =0 |
Returns number of defined colors, or -1 if undefined. More... | |
virtual void | invert () |
Inverts the ordering of the color ramp. More... | |
virtual QVariantMap | properties () const =0 |
Returns a string map containing all the color ramp's properties. More... | |
virtual QString | type () const =0 |
Returns a string representing the color ramp type. More... | |
virtual double | value (int index) const =0 |
Returns relative value between [0,1] of color at specified index. More... | |
Static Public Member Functions | |
static QgsColorRamp * | create (const QVariantMap &properties=QVariantMap()) |
Creates the symbol layer. More... | |
static QString | fileNameForVariant (const QString &schema, const QString &variant) |
Returns the source file name for a CPT schema and variant. More... | |
static QString | typeString () |
Returns the string identifier for QgsCptCityColorRamp. More... | |
![]() | |
static QgsColorRamp * | create (const QVariantMap &properties=QVariantMap()) |
Creates a new QgsColorRamp from a map of properties. More... | |
static QString | typeString () |
Returns the string identifier for QgsGradientColorRamp. More... | |
![]() | |
static QList< QPair< QString, QString > > | rampTypes () |
Returns a list of available ramp types, where the first value in each item is the QgsColorRamp::type() string and the second is a user friendly, translated name for the color ramp type. More... | |
Protected Attributes | |
bool | mFileLoaded = false |
bool | mInverted |
bool | mMultiStops = false |
QString | mSchemeName |
QStringList | mVariantList |
QString | mVariantName |
![]() | |
QColor | mColor1 |
QColor | mColor2 |
QColor::Spec | mColorSpec = QColor::Spec::Rgb |
Qgis::AngularDirection | mDirection = Qgis::AngularDirection::CounterClockwise |
bool | mDiscrete |
InterpolateColorFunc | mFunc = nullptr |
QgsStringMap | mInfo |
QgsGradientStopsList | mStops |
Definition at line 714 of file qgscolorrampimpl.h.
QgsCptCityColorRamp::QgsCptCityColorRamp | ( | const QString & | schemeName = DEFAULT_CPTCITY_SCHEMENAME , |
const QString & | variantName = DEFAULT_CPTCITY_VARIANTNAME , |
||
bool | inverted = false , |
||
bool | doLoadFile = true |
||
) |
Constructor for QgsCptCityColorRamp.
schemeName | cpt-city scheme name |
variantName | cpt-city variant name |
inverted | invert ramp ordering |
doLoadFile | load cpt-city ramp from file |
Definition at line 909 of file qgscolorrampimpl.cpp.
QgsCptCityColorRamp::QgsCptCityColorRamp | ( | const QString & | schemeName, |
const QStringList & | variantList, | ||
const QString & | variantName = QString() , |
||
bool | inverted = false , |
||
bool | doLoadFile = true |
||
) |
Constructor for QgsCptCityColorRamp.
schemeName | cpt-city scheme name |
variantList | cpt-city variant list |
variantName | cpt-city variant name |
inverted | invert ramp ordering |
doLoadFile | load cpt-city ramp from file |
Definition at line 922 of file qgscolorrampimpl.cpp.
|
overridevirtual |
Creates a clone of the color ramp.
Reimplemented from QgsGradientColorRamp.
Definition at line 965 of file qgscolorrampimpl.cpp.
QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp | ( | ) | const |
Definition at line 987 of file qgscolorrampimpl.cpp.
void QgsCptCityColorRamp::copy | ( | const QgsCptCityColorRamp * | other | ) |
Definition at line 972 of file qgscolorrampimpl.cpp.
QString QgsCptCityColorRamp::copyingFileName | ( | ) | const |
Definition at line 1028 of file qgscolorrampimpl.cpp.
QgsStringMap QgsCptCityColorRamp::copyingInfo | ( | ) | const |
Definition at line 1040 of file qgscolorrampimpl.cpp.
|
static |
Creates the symbol layer.
Definition at line 938 of file qgscolorrampimpl.cpp.
QString QgsCptCityColorRamp::descFileName | ( | ) | const |
Definition at line 1034 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 786 of file qgscolorrampimpl.h.
QString QgsCptCityColorRamp::fileName | ( | ) | const |
Definition at line 1018 of file qgscolorrampimpl.cpp.
|
static |
Returns the source file name for a CPT schema and variant.
Definition at line 1013 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 774 of file qgscolorrampimpl.h.
|
overridevirtual |
Inverts the ordering of the color ramp.
Reimplemented from QgsGradientColorRamp.
Definition at line 959 of file qgscolorrampimpl.cpp.
bool QgsCptCityColorRamp::loadFile | ( | ) |
Definition at line 1045 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 773 of file qgscolorrampimpl.h.
|
overridevirtual |
Returns a string map containing all the color ramp's properties.
Reimplemented from QgsGradientColorRamp.
Definition at line 1003 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 762 of file qgscolorrampimpl.h.
|
inline |
Definition at line 770 of file qgscolorrampimpl.h.
|
inline |
Definition at line 767 of file qgscolorrampimpl.h.
|
inline |
Definition at line 769 of file qgscolorrampimpl.h.
|
inline |
Definition at line 768 of file qgscolorrampimpl.h.
|
overridevirtual |
Returns a string representing the color ramp type.
Reimplemented from QgsGradientColorRamp.
Definition at line 954 of file qgscolorrampimpl.cpp.
|
inlinestatic |
Returns the string identifier for QgsCptCityColorRamp.
Definition at line 750 of file qgscolorrampimpl.h.
|
inline |
Definition at line 764 of file qgscolorrampimpl.h.
|
inline |
Definition at line 763 of file qgscolorrampimpl.h.
|
protected |
Definition at line 796 of file qgscolorrampimpl.h.
|
protected |
Definition at line 798 of file qgscolorrampimpl.h.
|
protected |
Definition at line 797 of file qgscolorrampimpl.h.
|
protected |
Definition at line 793 of file qgscolorrampimpl.h.
|
protected |
Definition at line 795 of file qgscolorrampimpl.h.
|
protected |
Definition at line 794 of file qgscolorrampimpl.h.