diff options
| author | Vasile Vilvoiu <vasi@vilvoiu.ro> | 2021-07-16 18:32:27 +0300 |
|---|---|---|
| committer | Vasile Vilvoiu <vasi@vilvoiu.ro> | 2021-07-16 18:32:27 +0300 |
| commit | 47bbfdbf1e2a6193157397938e76b16a1f60e789 (patch) | |
| tree | 5f90ac568bcd0ddfa2e885bacf4e4e996395d249 /src/configuration.hpp | |
| parent | 82c81858c65c80fb667e73ffdcc4ff69007cfa17 (diff) | |
Add support for arbitrary scales, with custom units.
Add support for linear scales.
Logging of scale to stderr.
Closes #9.
Diffstat (limited to 'src/configuration.hpp')
| -rw-r--r-- | src/configuration.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
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<double>; + using ScaleProperties = std::tuple<OptionalBound, OptionalBound, std::string>; + static ScaleProperties StringToScale(const std::string& str); + public: /* parse command line arguments and return a configuration object */ static std::tuple<Configuration, int, bool> 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_; } |
