comparison widgets/ColourMapComboBox.cpp @ 1362:d79e21855aef

Add mechanism for saving/loading colour maps by name/id rather than by numerical index, for future compatibility when adding to or changing the supported colour maps. Add two new colour maps (and one old one). Write out backward-compatible numerical indices for use when reloading in older versions. Also add a mechanism to invert the colour map, though I don't think it turns out useful enough to include in the UI.
author Chris Cannam
date Thu, 18 Oct 2018 13:21:56 +0100
parents a34a2a25907c
children
comparison
equal deleted inserted replaced
1361:2e3b3fadba27 1362:d79e21855aef
56 56
57 int size = (QFontMetrics(QFont()).height() * 2) / 3; 57 int size = (QFontMetrics(QFont()).height() * 2) / 3;
58 if (size < 12) size = 12; 58 if (size < 12) size = 12;
59 59
60 for (int i = 0; i < ColourMapper::getColourMapCount(); ++i) { 60 for (int i = 0; i < ColourMapper::getColourMapCount(); ++i) {
61 QString name = ColourMapper::getColourMapName(i); 61 QString name = ColourMapper::getColourMapLabel(i);
62 if (m_includeSwatches) { 62 if (m_includeSwatches) {
63 ColourMapper mapper(i, 0.0, 1.0); 63 ColourMapper mapper(i, false, 0.0, 1.0);
64 addItem(mapper.getExamplePixmap(QSize(size * 2, size)), name); 64 addItem(mapper.getExamplePixmap(QSize(size * 2, size)), name);
65 } else { 65 } else {
66 addItem(name); 66 addItem(name);
67 } 67 }
68 } 68 }