Mercurial > hg > svgui
comparison layer/ColourMapper.h @ 1216:dc2af6616c83
Merge from branch 3.0-integration
author | Chris Cannam |
---|---|
date | Fri, 13 Jan 2017 10:29:50 +0000 |
parents | 73d43e410a6b |
children | d79e21855aef |
comparison
equal
deleted
inserted
replaced
1048:e8102ff5573b | 1216:dc2af6616c83 |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _COLOUR_MAPPER_H_ | 16 #ifndef SV_COLOUR_MAPPER_H |
17 #define _COLOUR_MAPPER_H_ | 17 #define SV_COLOUR_MAPPER_H |
18 | 18 |
19 #include <QObject> | 19 #include <QObject> |
20 #include <QColor> | 20 #include <QColor> |
21 #include <QString> | 21 #include <QString> |
22 #include <QPixmap> | |
22 | 23 |
23 /** | 24 /** |
24 * A class for mapping intensity values onto various colour maps. | 25 * A class for mapping intensity values onto various colour maps. |
25 */ | 26 */ |
26 | 27 class ColourMapper |
27 class ColourMapper : public QObject | |
28 { | 28 { |
29 Q_OBJECT | |
30 | |
31 public: | 29 public: |
32 ColourMapper(int map, double minValue, double maxValue); | 30 ColourMapper(int map, double minValue, double maxValue); |
33 virtual ~ColourMapper(); | 31 ~ColourMapper(); |
32 | |
33 ColourMapper(const ColourMapper &) = default; | |
34 ColourMapper &operator=(const ColourMapper &) = default; | |
34 | 35 |
35 enum StandardMap { | 36 enum StandardMap { |
36 DefaultColours, | 37 Green, |
37 Sunset, | 38 Sunset, |
38 WhiteOnBlack, | 39 WhiteOnBlack, |
39 BlackOnWhite, | 40 BlackOnWhite, |
40 RedOnBlue, | 41 Cherry, |
41 YellowOnBlack, | 42 Wasp, |
42 BlueOnBlack, | 43 Ice, |
43 FruitSalad, | 44 FruitSalad, |
44 Banded, | 45 Banded, |
45 Highlight, | 46 Highlight, |
46 Printer, | 47 Printer, |
47 HighGain | 48 HighGain |
57 QColor map(double value) const; | 58 QColor map(double value) const; |
58 | 59 |
59 QColor getContrastingColour() const; // for cursors etc | 60 QColor getContrastingColour() const; // for cursors etc |
60 bool hasLightBackground() const; | 61 bool hasLightBackground() const; |
61 | 62 |
63 QPixmap getExamplePixmap(QSize size) const; | |
64 | |
62 protected: | 65 protected: |
63 int m_map; | 66 int m_map; |
64 double m_min; | 67 double m_min; |
65 double m_max; | 68 double m_max; |
66 }; | 69 }; |