aboutsummaryrefslogtreecommitdiff
path: root/colormap.h
diff options
context:
space:
mode:
Diffstat (limited to 'colormap.h')
-rw-r--r--colormap.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/colormap.h b/colormap.h
new file mode 100644
index 0000000..806624a
--- /dev/null
+++ b/colormap.h
@@ -0,0 +1,40 @@
+#ifndef COLORMAP_H
+#define COLORMAP_H
+
+#include <vector>
+
+#include <QtQuick>
+#include <QSGDynamicTexture>
+
+#include <armadillo>
+
+#include "colorscale.h"
+
+class Colormap
+ : public QQuickItem
+{
+ Q_OBJECT
+public:
+ static const int SAMPLES = 128;
+
+ Colormap(QQuickItem *parent = 0);
+ ~Colormap();
+
+signals:
+ void colorScaleChanged(const ColorScale &scale) const;
+
+public slots:
+ void setColorScale(const ColorScale &scale);
+
+protected:
+ QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
+
+private:
+ QSGNode *newSceneGraph();
+
+ QSGDynamicTexture *m_texture;
+ bool m_shouldUpdateTexture;
+ std::vector<float> m_cmap;
+};
+
+#endif // COLORMAP_H