QGIS API Documentation
3.6.0-Noosa (5873452)
|
#include <qgscolorramp.h>
Public Member Functions | |
QgsCptCityColorRamp (const QString &schemeName=DEFAULT_CPTCITY_SCHEMENAME, const QString &variantName=DEFAULT_CPTCITY_VARIANTNAME, bool inverted=false, bool doLoadFile=true) | |
Constructor for QgsCptCityColorRamp. More... | |
QgsCptCityColorRamp (const QString &schemeName, const QStringList &variantList, const QString &variantName=QString(), 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 () |
QgsStringMap | 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 |
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. More... | |
void | addStopsToGradient (QGradient *gradient, double opacity=1) |
Copy color ramp stops to a QGradient. 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... | |
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... | |
QgsStringMap | info () const |
Returns any additional info attached to the gradient ramp (e.g., authorship notes) More... | |
bool | isDiscrete () const |
Returns true if the gradient is using discrete interpolation, rather than smoothly interpolating between colors. More... | |
void | setColor1 (const QColor &color) |
Sets the gradient start color. More... | |
void | setColor2 (const QColor &color) |
Sets the gradient end color. 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... | |
double | value (int index) const override |
Returns relative value between [0,1] of color at specified index. More... | |
Public Member Functions inherited from QgsColorRamp | |
virtual | ~QgsColorRamp ()=default |
Static Public Member Functions | |
static QgsColorRamp * | create (const QgsStringMap &properties=QgsStringMap()) |
Static Public Member Functions inherited from QgsGradientColorRamp | |
static QgsColorRamp * | create (const QgsStringMap &properties=QgsStringMap()) |
Creates a new QgsColorRamp from a map of properties. More... | |
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 |
bool | mDiscrete |
QgsStringMap | mInfo |
QgsGradientStopsList | mStops |
Definition at line 626 of file qgscolorramp.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 588 of file qgscolorramp.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 601 of file qgscolorramp.cpp.
|
overridevirtual |
Creates a clone of the color ramp.
Reimplemented from QgsGradientColorRamp.
Definition at line 639 of file qgscolorramp.cpp.
QgsGradientColorRamp * QgsCptCityColorRamp::cloneGradientRamp | ( | ) | const |
Definition at line 661 of file qgscolorramp.cpp.
void QgsCptCityColorRamp::copy | ( | const QgsCptCityColorRamp * | other | ) |
Definition at line 646 of file qgscolorramp.cpp.
QString QgsCptCityColorRamp::copyingFileName | ( | ) | const |
Definition at line 698 of file qgscolorramp.cpp.
QgsStringMap QgsCptCityColorRamp::copyingInfo | ( | ) | const |
Definition at line 710 of file qgscolorramp.cpp.
|
static |
Definition at line 617 of file qgscolorramp.cpp.
QString QgsCptCityColorRamp::descFileName | ( | ) | const |
Definition at line 704 of file qgscolorramp.cpp.
|
inline |
Definition at line 682 of file qgscolorramp.h.
QString QgsCptCityColorRamp::fileName | ( | ) | const |
Definition at line 688 of file qgscolorramp.cpp.
|
inline |
Definition at line 678 of file qgscolorramp.h.
|
overridevirtual |
Inverts the ordering of the color ramp.
Reimplemented from QgsGradientColorRamp.
Definition at line 633 of file qgscolorramp.cpp.
bool QgsCptCityColorRamp::loadFile | ( | ) |
Definition at line 715 of file qgscolorramp.cpp.
|
inline |
Definition at line 677 of file qgscolorramp.h.
|
overridevirtual |
Returns a string map containing all the color ramp's properties.
Reimplemented from QgsGradientColorRamp.
Definition at line 677 of file qgscolorramp.cpp.
|
inline |
Definition at line 666 of file qgscolorramp.h.
|
inline |
Definition at line 674 of file qgscolorramp.h.
|
inline |
Definition at line 671 of file qgscolorramp.h.
|
inline |
Definition at line 673 of file qgscolorramp.h.
|
inline |
Definition at line 672 of file qgscolorramp.h.
|
inlineoverridevirtual |
Returns a string representing the color ramp type.
Reimplemented from QgsGradientColorRamp.
Definition at line 656 of file qgscolorramp.h.
|
inline |
Definition at line 668 of file qgscolorramp.h.
|
inline |
Definition at line 667 of file qgscolorramp.h.
|
protected |
Definition at line 692 of file qgscolorramp.h.
|
protected |
Definition at line 694 of file qgscolorramp.h.
|
protected |
Definition at line 693 of file qgscolorramp.h.
|
protected |
Definition at line 689 of file qgscolorramp.h.
|
protected |
Definition at line 691 of file qgscolorramp.h.
|
protected |
Definition at line 690 of file qgscolorramp.h.