summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii/wii_frame.cpp
diff options
context:
space:
mode:
authorWei Shuai <cpuwolf@gmail.com>2018-02-07 12:05:03 +0800
committerWei Shuai <cpuwolf@gmail.com>2018-02-07 12:05:03 +0800
commit993e6b18966af927563398e04c516a6fcafd8123 (patch)
tree70a560a701429dabf624e545a4201f92e45ad087 /tracker-wii/wii_frame.cpp
parent84a143aa1b9654e4133cb19016c3a95fbfb57bf2 (diff)
tracker/wii: enhance user friendly UI
1. add wii status wii_cam_wait_for_sync 2. add images show how user should do in preview window 3. reduce redundancy convertion about QImage by doing in WIIPreview Class
Diffstat (limited to 'tracker-wii/wii_frame.cpp')
-rw-r--r--tracker-wii/wii_frame.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tracker-wii/wii_frame.cpp b/tracker-wii/wii_frame.cpp
index 9e367926..16bcfab2 100644
--- a/tracker-wii/wii_frame.cpp
+++ b/tracker-wii/wii_frame.cpp
@@ -19,9 +19,12 @@ using namespace pt_module;
WIIPreview& WIIPreview::operator=(const pt_frame& frame_)
{
+ const struct wii_info& wii = frame_.as_const<WIIFrame>()->wii;
const cv::Mat& frame = frame_.as_const<const WIIFrame>()->mat;
ensure_size(frame_copy, frame_out.cols, frame_out.rows, CV_8UC3);
+ status = wii.status;
+
if (frame.channels() != 3)
{
once_only(qDebug() << "tracker/pt: camera frame depth: 3 !=" << frame.channels());
@@ -46,6 +49,12 @@ WIIPreview::WIIPreview(int w, int h)
QImage WIIPreview::get_bitmap()
{
+ switch (status) {
+ case wii_cam_wait_for_sync:
+ return QImage(":/Resources/sync.png");
+ case wii_cam_wait_for_connect:
+ return QImage(":/Resources/on.png");
+ }
int stride = frame_out.step.p[0];
if (stride < 64 || stride < frame_out.cols * 4)