comparison layer/ColourMapper.cpp @ 1071:65b183494331 spectrogram-minor-refactor

Start stubbing Colour3DPlotRenderer
author Chris Cannam
date Thu, 23 Jun 2016 17:07:21 +0100
parents 9c890b7dfa83
children 73d43e410a6b
comparison
equal deleted inserted replaced
1070:27163db978d8 1071:65b183494331
58 g = c0.greenF() * prop0 + c1.greenF() * prop1; 58 g = c0.greenF() * prop0 + c1.greenF() * prop1;
59 b = c0.blueF() * prop0 + c1.blueF() * prop1; 59 b = c0.blueF() * prop0 + c1.blueF() * prop1;
60 } 60 }
61 61
62 ColourMapper::ColourMapper(int map, double min, double max) : 62 ColourMapper::ColourMapper(int map, double min, double max) :
63 QObject(),
64 m_map(map), 63 m_map(map),
65 m_min(min), 64 m_min(min),
66 m_max(max) 65 m_max(max)
67 { 66 {
68 if (m_min == m_max) { 67 if (m_min == m_max) {
83 } 82 }
84 83
85 QString 84 QString
86 ColourMapper::getColourMapName(int n) 85 ColourMapper::getColourMapName(int n)
87 { 86 {
88 if (n >= getColourMapCount()) return tr("<unknown>"); 87 if (n >= getColourMapCount()) return QObject::tr("<unknown>");
89 StandardMap map = (StandardMap)n; 88 StandardMap map = (StandardMap)n;
90 89
91 switch (map) { 90 switch (map) {
92 case Green: return tr("Green"); 91 case Green: return QObject::tr("Green");
93 case WhiteOnBlack: return tr("White on Black"); 92 case WhiteOnBlack: return QObject::tr("White on Black");
94 case BlackOnWhite: return tr("Black on White"); 93 case BlackOnWhite: return QObject::tr("Black on White");
95 case Cherry: return tr("Cherry"); 94 case Cherry: return QObject::tr("Cherry");
96 case Wasp: return tr("Wasp"); 95 case Wasp: return QObject::tr("Wasp");
97 case Ice: return tr("Ice"); 96 case Ice: return QObject::tr("Ice");
98 case Sunset: return tr("Sunset"); 97 case Sunset: return QObject::tr("Sunset");
99 case FruitSalad: return tr("Fruit Salad"); 98 case FruitSalad: return QObject::tr("Fruit Salad");
100 case Banded: return tr("Banded"); 99 case Banded: return QObject::tr("Banded");
101 case Highlight: return tr("Highlight"); 100 case Highlight: return QObject::tr("Highlight");
102 case Printer: return tr("Printer"); 101 case Printer: return QObject::tr("Printer");
103 case HighGain: return tr("High Gain"); 102 case HighGain: return QObject::tr("High Gain");
104 } 103 }
105 104
106 return tr("<unknown>"); 105 return QObject::tr("<unknown>");
107 } 106 }
108 107
109 QColor 108 QColor
110 ColourMapper::map(double value) const 109 ColourMapper::map(double value) const
111 { 110 {