aboutsummaryrefslogtreecommitdiff
path: root/colormap.h
diff options
context:
space:
mode:
authorSamuel Fadel <samuel@nihil.ws>2023-05-23 11:22:33 +0200
committerSamuel Fadel <samuel@nihil.ws>2023-05-23 11:22:33 +0200
commit0f34fd437efb936ef29ac91186321aa7251fbfb1 (patch)
tree271e994828f4bb19c35b2630f2705cb64b8d4552 /colormap.h
parentbedf6936885694688ddb8bd3452f6bd68ef8d29c (diff)
Massive changes in initial port away from Qt.
Diffstat (limited to 'colormap.h')
-rw-r--r--colormap.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/colormap.h b/colormap.h
index 1039cfd..76577f5 100644
--- a/colormap.h
+++ b/colormap.h
@@ -1,21 +1,16 @@
#ifndef COLORMAP_H
#define COLORMAP_H
+#include <memory>
#include <vector>
-#include <QtQuick>
-#include <QSGDynamicTexture>
-
#include <armadillo>
+#include <nod.hpp>
#include "colorscale.h"
class Colormap
- : public QQuickItem
{
- Q_OBJECT
- Q_ENUMS(Orientation)
- Q_PROPERTY(Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
public:
static const int SAMPLES = 128;
@@ -24,26 +19,24 @@ public:
Vertical
};
- Colormap(QQuickItem *parent = 0);
+ Colormap();
~Colormap();
+ void update();
void setOrientation(Orientation orientation);
Orientation orientation() const { return m_orientation; }
-signals:
- void colorScaleChanged(const ColorScale *scale) const;
- void orientationChanged(Orientation orientation) const;
+ nod::signal<void(std::shared_ptr<const ColorScale>)> colorScaleChanged;
+ nod::signal<void(Orientation)> orientationChanged;
-public slots:
- void setColorScale(const ColorScale *scale);
+ void setColorScale(std::shared_ptr<const ColorScale> scale);
-protected:
- QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
+ // QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *);
private:
- QSGNode *newSceneGraph();
+ // QSGNode *newSceneGraph();
- QSGDynamicTexture *m_texture;
+ // QSGDynamicTexture *m_texture;
bool m_shouldUpdateTexture, m_shouldUpdateOrientation;
Orientation m_orientation;
std::vector<float> m_cmap;