summaryrefslogtreecommitdiffstats
path: root/matleap.hpp
diff options
context:
space:
mode:
authorNiklas Halle <niklas@niklashalle.net>2021-04-05 14:34:56 +0200
committerNiklas Halle <niklas@niklashalle.net>2021-04-05 14:37:22 +0200
commitea698a54a82ff5c20236ff09e592354dfe25798a (patch)
tree95ccf6d30176c67c5e64a473e422223418deba50 /matleap.hpp
parenteb0349db0084736e92ec6ab7c7cb9db5fae18624 (diff)
downloadwdti_project-ea698a54a82ff5c20236ff09e592354dfe25798a.tar.gz
wdti_project-ea698a54a82ff5c20236ff09e592354dfe25798a.zip
start cleanup
Diffstat (limited to 'matleap.hpp')
-rw-r--r--matleap.hpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/matleap.hpp b/matleap.hpp
new file mode 100644
index 0000000..0b8e732
--- /dev/null
+++ b/matleap.hpp
@@ -0,0 +1,60 @@
+/// @file matleap.h
+/// @brief leap motion controller interface
+/// @author Jeff Perry <jeffsp@gmail.com>
+/// @version 1.0
+/// @date 2013-09-12
+
+#ifndef MATLEAP_H
+#define MATLEAP_H
+
+#define MAJOR_REVISION 4
+#define MINOR_REVISION 0
+
+#include "Leap.h"
+#include "mex.h"
+
+#include <unistd.h>
+
+namespace matleap {
+
+/// @brief a leap frame
+ struct frame {
+ int64_t id;
+ int64_t timestamp;
+ uint32_t detectedHands;
+ Leap::HandList hands;
+ bool has_gesture;
+ };
+
+/// @brief leap frame grabber interface
+ class frame_grabber {
+ private:
+ bool debug;
+ Leap::Controller controllerConnection;
+ frame current_frame;
+
+ public:
+ /// @brief constructor
+ frame_grabber();
+
+ void open_connection();
+
+ void close_connection();
+
+ /// @brief destructor
+ ~frame_grabber();
+
+ /// @brief debug member access
+ ///
+ /// @param flag turn it on/off
+ void set_debug(bool flag);
+
+ /// @brief get a frame from the controller
+ ///
+ /// @return the frame
+ frame const &get_frame();
+ };
+
+} // namespace matleap
+
+#endif