diff options
| author | Vasile Vilvoiu <vasi@vilvoiu.ro> | 2021-07-16 21:00:28 +0300 |
|---|---|---|
| committer | Vasile Vilvoiu <vasi@vilvoiu.ro> | 2021-07-16 21:00:28 +0300 |
| commit | 68e6ebe24cb476997b2ddfc21a5b13fb6f332fa7 (patch) | |
| tree | 646db708a2db1b61904003c81a05b01358cdb4cc /src/color-map.hpp | |
| parent | b13609afcdf66d781db70fb75f6869a052a49079 (diff) | |
Render texture onto window on each iteration.
Keep colormap in renderer so we don't pass the colormapped windows like
animals.
Pre-render empty window.
Fixes #15.
Diffstat (limited to 'src/color-map.hpp')
| -rw-r--r-- | src/color-map.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/color-map.hpp b/src/color-map.hpp index 4c89275..139edaf 100644 --- a/src/color-map.hpp +++ b/src/color-map.hpp @@ -44,6 +44,8 @@ public: virtual std::vector<uint8_t> Map(const RealWindow& input) const = 0; std::vector<uint8_t> Gradient(std::size_t width) const; + + virtual std::unique_ptr<ColorMap> Copy() const = 0; }; class InterpolationColorMap : public ColorMap { @@ -53,13 +55,12 @@ private: std::vector<uint8_t> GetColor(double value) const; -protected: - InterpolationColorMap(const std::vector<sf::Color>& colors, const std::vector<double>& vals); - public: + InterpolationColorMap(const std::vector<sf::Color>& colors, const std::vector<double>& vals); InterpolationColorMap() = delete; std::vector<uint8_t> Map(const std::vector<double>& input) const override; + std::unique_ptr<ColorMap> Copy() const override; }; class TwoColorMap : public InterpolationColorMap { |
