QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
A color ramp from the CPT City collection. More...
#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. | |
QgsCptCityColorRamp (const QString &schemeName=DEFAULT_CPTCITY_SCHEMENAME, const QString &variantName=DEFAULT_CPTCITY_VARIANTNAME, bool inverted=false, bool doLoadFile=true) | |
Constructor for QgsCptCityColorRamp. | |
QgsCptCityColorRamp * | clone () const override |
Creates a clone of the color ramp. | |
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. | |
bool | loadFile () |
void | loadPalette () |
QVariantMap | properties () const override |
Returns a string map containing all the color ramp's properties. | |
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. | |
QStringList | variantList () const |
QString | variantName () const |
Public Member Functions inherited from QgsGradientColorRamp | |
QgsGradientColorRamp (const QColor &color1=DEFAULT_GRADIENT_COLOR1, const QColor &color2=DEFAULT_GRADIENT_COLOR2, bool discrete=false, const QgsGradientStopsList &stops=QgsGradientStopsList()) | |
Constructor for QgsGradientColorRamp. | |
void | addStopsToGradient (QGradient *gradient, double opacity=1) const |
Copy color ramp stops to a QGradient. | |
QgsGradientColorRamp * | clone () const override |
Creates a clone of the color ramp. | |
QColor | color (double value) const override |
Returns the color corresponding to a specified value. | |
QColor | color1 () const |
Returns the gradient start color. | |
QColor | color2 () const |
Returns the gradient end color. | |
QColor::Spec | colorSpec () const |
Returns the color specification in which the color component interpolation will occur. | |
void | convertToDiscrete (bool discrete) |
Converts a gradient with existing color stops to or from discrete interpolation. | |
int | count () const override |
Returns number of defined colors, or -1 if undefined. | |
Qgis::AngularDirection | direction () const |
Returns the direction to traverse the color wheel using when interpolating hue-based color specifications. | |
QgsStringMap | info () const |
Returns any additional info attached to the gradient ramp (e.g., authorship notes) | |
void | invert () override |
Inverts the ordering of the color ramp. | |
bool | isDiscrete () const |
Returns true if the gradient is using discrete interpolation, rather than smoothly interpolating between colors. | |
QVariantMap | properties () const override |
Returns a string map containing all the color ramp's properties. | |
void | setColor1 (const QColor &color) |
Sets the gradient start color. | |
void | setColor2 (const QColor &color) |
Sets the gradient end color. | |
void | setColorSpec (QColor::Spec spec) |
Sets the color specification in which the color component interpolation will occur. | |
void | setDirection (Qgis::AngularDirection direction) |
Sets the direction to traverse the color wheel using when interpolating hue-based color specifications. | |
void | setDiscrete (bool discrete) |
Sets whether the gradient should use discrete interpolation, rather than smoothly interpolating between colors. | |
void | setInfo (const QgsStringMap &info) |
Sets additional info to attach to the gradient ramp (e.g., authorship notes) | |
void | setStops (const QgsGradientStopsList &stops) |
Sets the list of intermediate gradient stops for the ramp. | |
QgsGradientStopsList | stops () const |
Returns the list of intermediate gradient stops for the ramp. | |
QString | type () const override |
Returns a string representing the color ramp type. | |
double | value (int index) const override |
Returns relative value between [0,1] of color at specified index. | |
Public Member Functions inherited from QgsColorRamp | |
virtual | ~QgsColorRamp () |
Static Public Member Functions | |
static QgsColorRamp * | create (const QVariantMap &properties=QVariantMap()) |
Creates the symbol layer. | |
static QString | fileNameForVariant (const QString &schema, const QString &variant) |
Returns the source file name for a CPT schema and variant. | |
static QString | typeString () |
Returns the string identifier for QgsCptCityColorRamp. | |
Static Public Member Functions inherited from QgsGradientColorRamp | |
static QgsColorRamp * | create (const QVariantMap &properties=QVariantMap()) |
Creates a new QgsColorRamp from a map of properties. | |
static QString | typeString () |
Returns the string identifier for QgsGradientColorRamp. | |
Static Public Member Functions inherited from QgsColorRamp | |
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. | |
Protected Attributes | |
bool | mFileLoaded = false |
bool | mInverted |
bool | mMultiStops = false |
QString | mSchemeName |
QStringList | mVariantList |
QString | mVariantName |
Protected Attributes inherited from QgsGradientColorRamp | |
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 |
A color ramp from the CPT City collection.
Definition at line 704 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 947 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 960 of file qgscolorrampimpl.cpp.
|
overridevirtual |
Creates a clone of the color ramp.
Implements QgsColorRamp.
Definition at line 1003 of file qgscolorrampimpl.cpp.
QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp | ( | ) | const |
Definition at line 1025 of file qgscolorrampimpl.cpp.
void QgsCptCityColorRamp::copy | ( | const QgsCptCityColorRamp * | other | ) |
Definition at line 1010 of file qgscolorrampimpl.cpp.
QString QgsCptCityColorRamp::copyingFileName | ( | ) | const |
Definition at line 1066 of file qgscolorrampimpl.cpp.
QgsStringMap QgsCptCityColorRamp::copyingInfo | ( | ) | const |
Definition at line 1078 of file qgscolorrampimpl.cpp.
|
static |
Creates the symbol layer.
Definition at line 976 of file qgscolorrampimpl.cpp.
QString QgsCptCityColorRamp::descFileName | ( | ) | const |
Definition at line 1072 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 776 of file qgscolorrampimpl.h.
QString QgsCptCityColorRamp::fileName | ( | ) | const |
Definition at line 1056 of file qgscolorrampimpl.cpp.
|
static |
Returns the source file name for a CPT schema and variant.
Definition at line 1051 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 764 of file qgscolorrampimpl.h.
|
overridevirtual |
Inverts the ordering of the color ramp.
Reimplemented from QgsColorRamp.
Definition at line 997 of file qgscolorrampimpl.cpp.
bool QgsCptCityColorRamp::loadFile | ( | ) |
Definition at line 1083 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 763 of file qgscolorrampimpl.h.
|
overridevirtual |
Returns a string map containing all the color ramp's properties.
Implements QgsColorRamp.
Definition at line 1041 of file qgscolorrampimpl.cpp.
|
inline |
Definition at line 752 of file qgscolorrampimpl.h.
|
inline |
Definition at line 760 of file qgscolorrampimpl.h.
|
inline |
Definition at line 757 of file qgscolorrampimpl.h.
|
inline |
Definition at line 759 of file qgscolorrampimpl.h.
|
inline |
Definition at line 758 of file qgscolorrampimpl.h.
|
overridevirtual |
Returns a string representing the color ramp type.
Implements QgsColorRamp.
Definition at line 992 of file qgscolorrampimpl.cpp.
|
inlinestatic |
Returns the string identifier for QgsCptCityColorRamp.
Definition at line 740 of file qgscolorrampimpl.h.
|
inline |
Definition at line 754 of file qgscolorrampimpl.h.
|
inline |
Definition at line 753 of file qgscolorrampimpl.h.
|
protected |
Definition at line 786 of file qgscolorrampimpl.h.
|
protected |
Definition at line 788 of file qgscolorrampimpl.h.
|
protected |
Definition at line 787 of file qgscolorrampimpl.h.
|
protected |
Definition at line 783 of file qgscolorrampimpl.h.
|
protected |
Definition at line 785 of file qgscolorrampimpl.h.
|
protected |
Definition at line 784 of file qgscolorrampimpl.h.