diff options
Diffstat (limited to 'tracker-pt/pt-api.hpp')
-rw-r--r-- | tracker-pt/pt-api.hpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/tracker-pt/pt-api.hpp b/tracker-pt/pt-api.hpp index 741576a1..15021ff3 100644 --- a/tracker-pt/pt-api.hpp +++ b/tracker-pt/pt-api.hpp @@ -6,11 +6,9 @@ #include "options/options.hpp" #include <tuple> -#include <type_traits> +#include <vector> #include <memory> -#include <opencv2/core.hpp> - #include <QImage> #include <QString> @@ -32,6 +30,7 @@ struct pt_camera_info final int res_x = 0; int res_y = 0; QString name; + bool use_mjpeg = false; }; struct pt_pixel_pos_mixin @@ -58,11 +57,21 @@ struct pt_frame : pt_pixel_pos_mixin { return static_cast<t const*>(this); } + +protected: + pt_frame(const pt_frame&) = default; + pt_frame(pt_frame&&) = default; + pt_frame& operator=(const pt_frame&) = default; + pt_frame& operator=(pt_frame&&) = default; }; struct pt_preview : pt_frame { - virtual pt_preview& operator=(const pt_frame&) = 0; + pt_preview() = default; + + OTR_DISABLE_MOVE_COPY(pt_preview); + + virtual void set_last_frame(const pt_frame&) = 0; virtual QImage get_bitmap() = 0; virtual void draw_head_center(f x, f y) = 0; }; @@ -75,7 +84,9 @@ struct pt_camera pt_camera(); virtual ~pt_camera(); - [[nodiscard]] virtual bool start(const QString& name, int fps, int res_x, int res_y) = 0; + OTR_DISABLE_MOVE_COPY(pt_camera); + + [[nodiscard]] virtual bool start(const pt_settings& s) = 0; virtual void stop() = 0; virtual result get_frame(pt_frame& frame) = 0; @@ -87,6 +98,7 @@ struct pt_camera virtual void set_fov(f value) = 0; virtual void show_camera_settings() = 0; + virtual f deadzone_amount() const { return 1; } }; struct pt_point_extractor : pt_pixel_pos_mixin @@ -94,9 +106,11 @@ struct pt_point_extractor : pt_pixel_pos_mixin using vec2 = numeric_types::vec2; using f = numeric_types::f; + OTR_DISABLE_MOVE_COPY(pt_point_extractor); + pt_point_extractor(); virtual ~pt_point_extractor(); - virtual void extract_points(const pt_frame& image, pt_preview& preview_frame, std::vector<vec2>& points) = 0; + virtual void extract_points(const pt_frame& image, pt_preview& preview_frame, bool preview_visible, std::vector<vec2>& points) = 0; static f threshold_radius_value(int w, int h, int threshold); }; @@ -105,6 +119,8 @@ struct pt_runtime_traits { template<typename t> using pointer = std::shared_ptr<t>; + OTR_DISABLE_MOVE_COPY(pt_runtime_traits); + pt_runtime_traits(); virtual ~pt_runtime_traits(); |