00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef _COLOUR_MAPPER_H_
00017 #define _COLOUR_MAPPER_H_
00018
00019 #include <QObject>
00020 #include <QColor>
00021 #include <QString>
00022
00027 class ColourMapper : public QObject
00028 {
00029 Q_OBJECT
00030
00031 public:
00032 ColourMapper(int map, float minValue, float maxValue);
00033 virtual ~ColourMapper();
00034
00035 enum StandardMap {
00036 DefaultColours,
00037 Sunset,
00038 WhiteOnBlack,
00039 BlackOnWhite,
00040 RedOnBlue,
00041 YellowOnBlack,
00042 BlueOnBlack,
00043 FruitSalad,
00044 Banded,
00045 Highlight,
00046 Printer
00047 };
00048
00049 int getMap() const { return m_map; }
00050 float getMinValue() const { return m_min; }
00051 float getMaxValue() const { return m_max; }
00052
00053 static int getColourMapCount();
00054 static QString getColourMapName(int n);
00055
00056 QColor map(float value) const;
00057
00058 QColor getContrastingColour() const;
00059 bool hasLightBackground() const;
00060
00061 protected:
00062 int m_map;
00063 float m_min;
00064 float m_max;
00065 };
00066
00067 #endif
00068