#ifndef COLORMAP_H #define COLORMAP_H #include #include #include #include #include #include "colorscale.h" class Colormap { public: static const int SAMPLES = 128; enum Orientation { Horizontal, Vertical }; Colormap(); ~Colormap(); GLuint texture() const { return m_texture; } size_t width() const { return m_width; } size_t height() const { return m_height; } void update(); void setOrientation(Orientation orientation); Orientation orientation() const { return m_orientation; } nod::signal)> colorScaleChanged; nod::signal orientationChanged; void setColorScale(std::shared_ptr scale); private: void updateTexture(); size_t m_width, m_height; GLuint m_texture; bool m_shouldUpdateTexture; Orientation m_orientation; std::vector m_cmap; }; #endif // COLORMAP_H