diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2021-09-25 06:04:31 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2021-09-26 11:22:50 +0200 |
commit | 663269bcbdf98a6b6645f0792a2aaae3a6816162 (patch) | |
tree | 9522639fef67881e892f8bd78cb82c1706379510 /tracker-wii | |
parent | ba5603ada3d2314e0e75838763c2ac9f583fc3dc (diff) |
tracker/{pt,wii}: skip more widget drawing when minimized
Diffstat (limited to 'tracker-wii')
-rw-r--r-- | tracker-wii/wii_point_extractor.cpp | 7 | ||||
-rw-r--r-- | tracker-wii/wii_point_extractor.h | 5 |
2 files changed, 9 insertions, 3 deletions
diff --git a/tracker-wii/wii_point_extractor.cpp b/tracker-wii/wii_point_extractor.cpp index 393dc1c9..5e860c14 100644 --- a/tracker-wii/wii_point_extractor.cpp +++ b/tracker-wii/wii_point_extractor.cpp @@ -100,12 +100,15 @@ void WIIPointExtractor::draw_bg(cv::Mat& preview_frame, const struct wii_info& w 1); } -void WIIPointExtractor::extract_points(const pt_frame& frame_, pt_preview& preview_frame_, std::vector<vec2>& points) +void WIIPointExtractor::extract_points(const pt_frame& frame_, + pt_preview& preview_frame_, + bool preview_visible, + std::vector<vec2>& points) { const struct wii_info& wii = frame_.as_const<WIIFrame>()->wii; cv::Mat& preview_frame = *preview_frame_.as<WIIPreview>(); - if (wii.status == wii_cam_data_change) + if (preview_visible && wii.status == wii_cam_data_change) { draw_bg(preview_frame, wii); draw_points(preview_frame, wii, points); diff --git a/tracker-wii/wii_point_extractor.h b/tracker-wii/wii_point_extractor.h index 4208f1b2..4a6f038b 100644 --- a/tracker-wii/wii_point_extractor.h +++ b/tracker-wii/wii_point_extractor.h @@ -23,7 +23,10 @@ class WIIPointExtractor final : public pt_point_extractor public: // extracts points from frame and draws some processing info into frame, if draw_output is set // dt: time since last call in seconds - void extract_points(const pt_frame& frame, pt_preview& preview_frame, std::vector<vec2>& points) override; + void extract_points(const pt_frame& frame, + pt_preview& preview_frame, + bool preview_visible, + std::vector<vec2>& points) override; WIIPointExtractor(const QString& module_name); private: |