summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/module/module.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-01-18 23:45:42 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-01-18 23:55:02 +0100
commit0657dc14e07ee705a8ab0bba67dfbe04c603db49 (patch)
treee554cf0c59ddf710bb8c2b3bae3c478f5b9ffb66 /tracker-pt/module/module.cpp
parent65523fe1304a7e61889abb1e6854192a43c6dcf0 (diff)
tracker/pt: move impl bits away from pt-base
Diffstat (limited to 'tracker-pt/module/module.cpp')
-rw-r--r--tracker-pt/module/module.cpp69
1 files changed, 69 insertions, 0 deletions
diff --git a/tracker-pt/module/module.cpp b/tracker-pt/module/module.cpp
new file mode 100644
index 00000000..5c298ca5
--- /dev/null
+++ b/tracker-pt/module/module.cpp
@@ -0,0 +1,69 @@
+#include "ftnoir_tracker_pt.h"
+#include "api/plugin-api.hpp"
+
+#include "camera.h"
+#include "frame.hpp"
+#include "point_extractor.h"
+#include "ftnoir_tracker_pt_dialog.h"
+
+#include "pt-api.hpp"
+
+#include <memory>
+
+static const QString module_name = "tracker-pt";
+
+using namespace pt_module;
+
+struct pt_module_traits final : pt_runtime_traits
+{
+ pointer<pt_camera> make_camera() const override
+ {
+ return pointer<pt_camera>(new Camera(module_name));
+ }
+
+ pointer<pt_point_extractor> make_point_extractor() const override
+ {
+ return pointer<pt_point_extractor>(new PointExtractor(module_name));
+ }
+
+ QString get_module_name() const override
+ {
+ return module_name;
+ }
+
+ pointer<pt_frame> make_frame() const override
+ {
+ return pointer<pt_frame>(new Frame);
+ }
+
+ pointer<pt_preview> make_preview(int w, int h) const override
+ {
+ return pointer<pt_preview>(new Preview(w, h));
+ }
+};
+
+struct tracker_pt : Tracker_PT
+{
+ tracker_pt() : Tracker_PT(pointer<pt_runtime_traits>(new pt_module_traits))
+ {
+ }
+};
+
+struct dialog_pt : TrackerDialog_PT
+{
+ dialog_pt();
+};
+
+class metadata_pt : public Metadata
+{
+ QString name() { return _("PointTracker 1.1"); }
+ QIcon icon() { return QIcon(":/Resources/Logo_IR.png"); }
+};
+
+// ns pt_module
+
+using namespace pt_module;
+
+dialog_pt::dialog_pt() : TrackerDialog_PT(module_name) {}
+
+OPENTRACK_DECLARE_TRACKER(tracker_pt, dialog_pt, metadata_pt)