summaryrefslogtreecommitdiff
path: root/src/color-map.hpp
diff options
context:
space:
mode:
authorVasile Vilvoiu <vasi@vilvoiu.ro>2021-07-16 21:00:28 +0300
committerVasile Vilvoiu <vasi@vilvoiu.ro>2021-07-16 21:00:28 +0300
commit68e6ebe24cb476997b2ddfc21a5b13fb6f332fa7 (patch)
tree646db708a2db1b61904003c81a05b01358cdb4cc /src/color-map.hpp
parentb13609afcdf66d781db70fb75f6869a052a49079 (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.hpp7
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 {