summaryrefslogtreecommitdiffhomepage
path: root/tracker-rs/imagewidget.cpp
diff options
context:
space:
mode:
authorXavier Hallade <xavier.hallade@intel.com>2016-02-03 23:40:48 +0100
committerXavier Hallade <xavier.hallade@intel.com>2016-02-03 23:40:48 +0100
commitf41f404de607b4f8f5aa270e36ae7c43baf63862 (patch)
tree662e30d2765275a13fbff952135b134802168a20 /tracker-rs/imagewidget.cpp
parente3044329f73fcfb136bb8316df87c4bafd2c2bee (diff)
tracker/rs: added camera preview, removed separate process and TCP socket
the RS implementation still resides in a different DLL as it has to be compiled separately by MSVC compiler.
Diffstat (limited to 'tracker-rs/imagewidget.cpp')
-rw-r--r--tracker-rs/imagewidget.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tracker-rs/imagewidget.cpp b/tracker-rs/imagewidget.cpp
new file mode 100644
index 00000000..0136c621
--- /dev/null
+++ b/tracker-rs/imagewidget.cpp
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2015, Intel Corporation
+ * Author: Xavier Hallade <xavier.hallade@intel.com>
+ * 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.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include "imagewidget.h"
+#include <QPainter>
+
+ImageWidget::ImageWidget(QWidget *parent) :
+ QWidget(parent), mImage(640, 480, QImage::Format_Grayscale8)
+{
+ mImage.fill(Qt::gray);
+}
+
+void ImageWidget::setImage(const QImage image)
+{
+ mImage = image;
+ repaint();
+}
+
+void ImageWidget::paintEvent(QPaintEvent*)
+{
+ QPainter painter(this);
+ painter.drawImage(rect(), mImage, mImage.rect());
+}