summaryrefslogtreecommitdiffhomepage
path: root/tracker-easy/preview.h
diff options
context:
space:
mode:
authorStéphane Lenclud <github@lenclud.com>2019-04-13 12:31:56 +0200
committerStéphane Lenclud <github@lenclud.com>2019-04-24 18:46:12 +0200
commitac8f7a3e7b29a5ce60ae751ee3a97e3b344c8f3f (patch)
treec68b70d8021be1937a4254af165e6df0c3f02083 /tracker-easy/preview.h
parent4af0298b4844727e87964697357af088b63921d1 (diff)
Easy Tracker: Renaming frame to preview.
Diffstat (limited to 'tracker-easy/preview.h')
-rw-r--r--tracker-easy/preview.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/tracker-easy/preview.h b/tracker-easy/preview.h
new file mode 100644
index 00000000..fc7ec9c9
--- /dev/null
+++ b/tracker-easy/preview.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2019 Stephane Lenclud
+ *
+ * Permission to use, copy, modify, and/or distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ */
+
+
+#pragma once
+
+#include "tracker-easy-api.h"
+
+#include <opencv2/core.hpp>
+#include <QImage>
+
+struct Preview
+{
+ Preview(int w, int h);
+
+ Preview& operator=(const cv::Mat& frame);
+ QImage get_bitmap();
+ void draw_head_center(numeric_types::f x, numeric_types::f y);
+
+ operator cv::Mat&() { return iFrameResized; }
+ operator cv::Mat const&() const { return iFrameResized; }
+
+private:
+ static void ensure_size(cv::Mat& frame, int w, int h, int type);
+
+public:
+ cv::Mat iFrameResized, frame_out;
+ cv::Mat iFrameRgb;
+};
+
+