summaryrefslogtreecommitdiffhomepage
path: root/tracker-pt/tracker-wii/wii_module.cpp
diff options
context:
space:
mode:
authorWei Shuai <cpuwolf@gmail.com>2018-01-15 17:08:48 +0800
committerWei Shuai <cpuwolf@gmail.com>2018-01-20 07:21:34 +0800
commit911e9deb712bafb5f622e215e286744696e90617 (patch)
tree9b6d365566a8a9934bb7b5dce7b924aa0bc8bbf4 /tracker-pt/tracker-wii/wii_module.cpp
parentc49530ad99720fa638191db667610542bec3c696 (diff)
add Wiimote supporting in point tracker
1. extrack point from wii frame 2. wii_camera outputs wii raw data, wii_extractor create preview 3. wiimote fov is about 42 degree 4. wii:change block functions to non-block function "contains WiiYourself! wiimote code by gl.tter http://gl.tter.org"
Diffstat (limited to 'tracker-pt/tracker-wii/wii_module.cpp')
-rw-r--r--tracker-pt/tracker-wii/wii_module.cpp72
1 files changed, 72 insertions, 0 deletions
diff --git a/tracker-pt/tracker-wii/wii_module.cpp b/tracker-pt/tracker-wii/wii_module.cpp
new file mode 100644
index 00000000..2f04ec9a
--- /dev/null
+++ b/tracker-pt/tracker-wii/wii_module.cpp
@@ -0,0 +1,72 @@
+#include "ftnoir_tracker_pt.h"
+#include "api/plugin-api.hpp"
+
+#include "wii_camera.h"
+#include "wii_frame.hpp"
+#include "wii_point_extractor.h"
+#include "ftnoir_tracker_pt_dialog.h"
+
+#include "pt-api.hpp"
+
+#include <memory>
+
+static const QString module_name = "tracker-wii-pt";
+
+using namespace pt_module;
+
+struct wii_pt_module_traits final : pt_runtime_traits
+{
+ pointer<pt_camera> make_camera() const override
+ {
+ return pointer<pt_camera>(new WIICamera(module_name));
+ }
+
+ pointer<pt_point_extractor> make_point_extractor() const override
+ {
+ return pointer<pt_point_extractor>(new WIIPointExtractor(module_name));
+ }
+
+ QString get_module_name() const override
+ {
+ return module_name;
+ }
+
+ pointer<pt_frame> make_frame() const override
+ {
+ return pointer<pt_frame>(new WIIFrame);
+ }
+
+ pointer<pt_preview> make_preview(int w, int h) const override
+ {
+ return pointer<pt_preview>(new WIIPreview(w, h));
+ }
+};
+
+struct wii_tracker_pt : Tracker_PT
+{
+ wii_tracker_pt() : Tracker_PT(pointer<pt_runtime_traits>(new wii_pt_module_traits))
+ {
+ }
+};
+
+
+struct wii_dialog_pt : TrackerDialog_PT
+{
+ wii_dialog_pt();
+};
+
+class wii_metadata_pt : public Metadata
+{
+ QString name() { return _("WiiPointTracker 1.1"); }
+ QIcon icon() { return QIcon(":/Resources/wii.png"); }
+};
+
+// ns pt_module
+
+using namespace pt_module;
+
+
+
+wii_dialog_pt::wii_dialog_pt() : TrackerDialog_PT(module_name) {}
+
+OPENTRACK_DECLARE_TRACKER(wii_tracker_pt, wii_dialog_pt, wii_metadata_pt)