/usr/include/qgis/qgsvectorcolorrampv2.h is in libqgis-dev 1.7.4+1.7.5~20120320-1.1+b1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | #ifndef QGSVECTORCOLORRAMPV2_H
#define QGSVECTORCOLORRAMPV2_H
#include <QColor>
#include "qgssymbollayerv2.h" // for QgsStringMap
class CORE_EXPORT QgsVectorColorRampV2
{
public:
virtual ~QgsVectorColorRampV2() {}
virtual QColor color( double value ) const = 0;
virtual QString type() const = 0;
virtual QgsVectorColorRampV2* clone() const = 0;
virtual QgsStringMap properties() const = 0;
};
#define DEFAULT_GRADIENT_COLOR1 QColor(0,0,255)
#define DEFAULT_GRADIENT_COLOR2 QColor(0,255,0)
class CORE_EXPORT QgsVectorGradientColorRampV2 : public QgsVectorColorRampV2
{
public:
QgsVectorGradientColorRampV2( QColor color1 = DEFAULT_GRADIENT_COLOR1,
QColor color2 = DEFAULT_GRADIENT_COLOR2 );
static QgsVectorColorRampV2* create( const QgsStringMap& properties = QgsStringMap() );
virtual QColor color( double value ) const;
virtual QString type() const { return "gradient"; }
virtual QgsVectorColorRampV2* clone() const;
virtual QgsStringMap properties() const;
QColor color1() const { return mColor1; }
QColor color2() const { return mColor2; }
void setColor1( QColor color ) { mColor1 = color; }
void setColor2( QColor color ) { mColor2 = color; }
typedef QMap<double, QColor> StopsMap;
void setStops( const StopsMap& stops ) { mStops = stops; }
const StopsMap& stops() const { return mStops; }
protected:
QColor mColor1, mColor2;
StopsMap mStops;
};
#define DEFAULT_RANDOM_COUNT 10
#define DEFAULT_RANDOM_HUE_MIN 0
#define DEFAULT_RANDOM_HUE_MAX 359
#define DEFAULT_RANDOM_VAL_MIN 0
#define DEFAULT_RANDOM_VAL_MAX 255
#define DEFAULT_RANDOM_SAT_MIN 0
#define DEFAULT_RANDOM_SAT_MAX 255
class CORE_EXPORT QgsVectorRandomColorRampV2 : public QgsVectorColorRampV2
{
public:
QgsVectorRandomColorRampV2( int count = DEFAULT_RANDOM_COUNT,
int hueMin = DEFAULT_RANDOM_HUE_MIN, int hueMax = DEFAULT_RANDOM_HUE_MAX,
int satMin = DEFAULT_RANDOM_SAT_MIN, int satMax = DEFAULT_RANDOM_SAT_MAX,
int valMin = DEFAULT_RANDOM_VAL_MIN, int valMax = DEFAULT_RANDOM_VAL_MAX );
static QgsVectorColorRampV2* create( const QgsStringMap& properties = QgsStringMap() );
virtual QColor color( double value ) const;
virtual QString type() const { return "random"; }
virtual QgsVectorColorRampV2* clone() const;
virtual QgsStringMap properties() const;
void updateColors();
int count() const { return mCount; }
int hueMin() const { return mHueMin; }
int hueMax() const { return mHueMax; }
int satMin() const { return mSatMin; }
int satMax() const { return mSatMax; }
int valMin() const { return mValMin; }
int valMax() const { return mValMax; }
void setCount( int val ) { mCount = val; }
void setHueMin( int val ) { mHueMin = val; }
void setHueMax( int val ) { mHueMax = val; }
void setSatMin( int val ) { mSatMin = val; }
void setSatMax( int val ) { mSatMax = val; }
void setValMin( int val ) { mValMin = val; }
void setValMax( int val ) { mValMax = val; }
protected:
int mCount;
int mHueMin, mHueMax, mSatMin, mSatMax, mValMin, mValMax;
QList<QColor> mColors;
};
#define DEFAULT_COLORBREWER_SCHEMENAME "Spectral"
#define DEFAULT_COLORBREWER_COLORS 5
class CORE_EXPORT QgsVectorColorBrewerColorRampV2 : public QgsVectorColorRampV2
{
public:
QgsVectorColorBrewerColorRampV2( QString schemeName = DEFAULT_COLORBREWER_SCHEMENAME,
int colors = DEFAULT_COLORBREWER_COLORS );
static QgsVectorColorRampV2* create( const QgsStringMap& properties = QgsStringMap() );
virtual QColor color( double value ) const;
virtual QString type() const { return "colorbrewer"; }
virtual QgsVectorColorRampV2* clone() const;
virtual QgsStringMap properties() const;
QString schemeName() const { return mSchemeName; }
int colors() const { return mColors; }
void setSchemeName( QString schemeName ) { mSchemeName = schemeName; loadPalette(); }
void setColors( int colors ) { mColors = colors; loadPalette(); }
static QStringList listSchemeNames();
static QList<int> listSchemeVariants( QString schemeName );
protected:
void loadPalette();
QString mSchemeName;
int mColors;
QList<QColor> mPalette;
};
#endif
|