From 47bbfdbf1e2a6193157397938e76b16a1f60e789 Mon Sep 17 00:00:00 2001 From: Vasile Vilvoiu Date: Fri, 16 Jul 2021 18:32:27 +0300 Subject: Add support for arbitrary scales, with custom units. Add support for linear scales. Logging of scale to stderr. Closes #9. --- src/configuration.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/configuration.hpp') diff --git a/src/configuration.hpp b/src/configuration.hpp index db3be73..f6fff18 100644 --- a/src/configuration.hpp +++ b/src/configuration.hpp @@ -39,8 +39,10 @@ private: std::size_t width_; double min_freq_; double max_freq_; - ValueMapType scale_; + ValueMapType scale_type_; + std::string scale_unit_; double scale_lower_bound_; + double scale_upper_bound_; ColorMapType color_map_; sf::Color color_map_custom_color_; sf::Color background_color_; @@ -69,6 +71,10 @@ private: static sf::Color StringToColor(const std::string& str); + using OptionalBound = std::optional; + using ScaleProperties = std::tuple; + static ScaleProperties StringToScale(const std::string& str); + public: /* parse command line arguments and return a configuration object */ static std::tuple FromArgs(int argc, char **argv); @@ -98,8 +104,10 @@ public: auto GetWidth() const { return width_; } auto GetMinFreq() const { return min_freq_; } auto GetMaxFreq() const { return max_freq_; } - auto GetScale() const { return scale_; } + auto GetScaleType() const { return scale_type_; } + auto GetScaleUnit() const { return scale_unit_; } auto GetScaleLowerBound() const { return scale_lower_bound_; } + auto GetScaleUpperBound() const { return scale_upper_bound_; } auto GetColorMap() const { return color_map_; } auto GetColorMapCustomColor() const { return color_map_custom_color_; } auto GetBackgroundColor() const { return background_color_; } -- cgit v1.2.3