comparison layer/ColourMapper.cpp @ 274:b9380f679f70

* Fix centre line position * Fix failure to update overview when generating peaks from wav file * Provide y-coordinate scale values and differences for spectrum measurement mode, and fix values for waveform (inc dB for both) * Add Printer colour scheme (may be futile)
author Chris Cannam
date Mon, 02 Jul 2007 13:04:17 +0000
parents 28c8e8e3c537
children
comparison
equal deleted inserted replaced
273:e954c00cbe55 274:b9380f679f70
37 } 37 }
38 38
39 int 39 int
40 ColourMapper::getColourMapCount() 40 ColourMapper::getColourMapCount()
41 { 41 {
42 return 10; 42 return 11;
43 } 43 }
44 44
45 QString 45 QString
46 ColourMapper::getColourMapName(int n) 46 ColourMapper::getColourMapName(int n)
47 { 47 {
57 case BlueOnBlack: return tr("Blue on Black"); 57 case BlueOnBlack: return tr("Blue on Black");
58 case Sunset: return tr("Sunset"); 58 case Sunset: return tr("Sunset");
59 case FruitSalad: return tr("Fruit Salad"); 59 case FruitSalad: return tr("Fruit Salad");
60 case Banded: return tr("Banded"); 60 case Banded: return tr("Banded");
61 case Highlight: return tr("Highlight"); 61 case Highlight: return tr("Highlight");
62 case Printer: return tr("Printer");
62 } 63 }
63 64
64 return tr("<unknown>"); 65 return tr("<unknown>");
65 } 66 }
66 67
155 break; 156 break;
156 157
157 case Highlight: 158 case Highlight:
158 if (norm > 0.99) return Qt::white; 159 if (norm > 0.99) return Qt::white;
159 else return Qt::darkBlue; 160 else return Qt::darkBlue;
161
162 case Printer:
163 if (norm > 0.8) {
164 r = 1.f;
165 } else if (norm > 0.7) {
166 r = 0.9f;
167 } else if (norm > 0.6) {
168 r = 0.8f;
169 } else if (norm > 0.5) {
170 r = 0.7f;
171 } else if (norm > 0.4) {
172 r = 0.6f;
173 } else if (norm > 0.3) {
174 r = 0.5f;
175 } else if (norm > 0.2) {
176 r = 0.4f;
177 } else {
178 r = 0.f;
179 }
180 r = g = b = 1.f - r;
181 hsv = false;
182 break;
160 } 183 }
161 184
162 if (hsv) { 185 if (hsv) {
163 return QColor::fromHsvF(h, s, v); 186 return QColor::fromHsvF(h, s, v);
164 } else { 187 } else {
201 case Banded: 224 case Banded:
202 return Qt::cyan; 225 return Qt::cyan;
203 226
204 case Highlight: 227 case Highlight:
205 return Qt::red; 228 return Qt::red;
229
230 case Printer:
231 return Qt::red;
206 } 232 }
207 233
208 return Qt::white; 234 return Qt::white;
209 } 235 }
210 236