summaryrefslogtreecommitdiffhomepage
path: root/tracker-wii/wii_frame.cpp
diff options
context:
space:
mode:
authorWei Shuai <cpuwolf@sina.com>2018-02-08 06:51:33 +0800
committerGitHub <noreply@github.com>2018-02-08 06:51:33 +0800
commit938d7987047179d3bac4a4fcaaed9fbbe3424bbf (patch)
treee3ccfcbb2720af4ac05f31dfcb3c3bd919d3491e /tracker-wii/wii_frame.cpp
parent48b0266eb73f233fa0c031b7b9dab96f476be141 (diff)
parentb62f4a94932785203ad133565575bc5cf0f0f408 (diff)
Merge pull request #742 from cpuwolf/autopair4
tracker/wii: add WIImote auto-pair function
Diffstat (limited to 'tracker-wii/wii_frame.cpp')
-rw-r--r--tracker-wii/wii_frame.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tracker-wii/wii_frame.cpp b/tracker-wii/wii_frame.cpp
index 9e367926..9332a704 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,14 @@ WIIPreview::WIIPreview(int w, int h)
QImage WIIPreview::get_bitmap()
{
+ switch (status) {
+ case wii_cam_wait_for_dongle:
+ return QImage(":/Resources/usb.png");
+ 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)