diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-18 23:45:42 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-18 23:55:02 +0100 |
commit | 0657dc14e07ee705a8ab0bba67dfbe04c603db49 (patch) | |
tree | e554cf0c59ddf710bb8c2b3bae3c478f5b9ffb66 /tracker-pt/module/frame.hpp | |
parent | 65523fe1304a7e61889abb1e6854192a43c6dcf0 (diff) |
tracker/pt: move impl bits away from pt-base
Diffstat (limited to 'tracker-pt/module/frame.hpp')
-rw-r--r-- | tracker-pt/module/frame.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tracker-pt/module/frame.hpp b/tracker-pt/module/frame.hpp new file mode 100644 index 00000000..9e4f809a --- /dev/null +++ b/tracker-pt/module/frame.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include "pt-api.hpp" + +#include <opencv2/core.hpp> +#include <QImage> + +namespace pt_module { + +struct Frame final : pt_frame +{ + cv::Mat mat; + + operator const cv::Mat&() const& { return mat; } + operator cv::Mat&() & { return mat; } +}; + +struct Preview final : pt_preview +{ + Preview(int w, int h); + + Preview& operator=(const pt_frame& frame) override; + QImage get_bitmap() override; + void draw_head_center(double x, double y) override; + + operator cv::Mat&() { return frame_copy; } + operator cv::Mat const&() const { return frame_copy; } + +private: + static void ensure_size(cv::Mat& frame, int w, int h, int type); + + bool fresh = true; + cv::Mat frame_copy, frame_color, frame_out; +}; + +} // ns pt_module |