Mercurial > hg > svgui
diff layer/ColourScale.h @ 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 |
line wrap: on
line diff
--- a/layer/ColourScale.h Fri Oct 12 11:17:29 2018 +0100 +++ b/layer/ColourScale.h Thu Oct 18 13:21:56 2018 +0100 @@ -36,7 +36,7 @@ public: struct Parameters { Parameters() : colourMap(0), scaleType(ColourScaleType::Linear), - minValue(0.0), maxValue(1.0), + minValue(0.0), maxValue(1.0), inverted(false), threshold(0.0), gain(1.0), multiple(1.0) { } /** A colour map index as used by ColourMapper */ @@ -51,6 +51,9 @@ /** Maximum value in source range. Must be > minValue */ double maxValue; + /** Whether the colour scale should be mapped inverted */ + bool inverted; + /** Threshold below which every value is mapped to background pixel 0 */ double threshold;