From f41f404de607b4f8f5aa270e36ae7c43baf63862 Mon Sep 17 00:00:00 2001 From: Xavier Hallade Date: Wed, 3 Feb 2016 23:40:48 +0100 Subject: 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. --- tracker-rs/imagewidget.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tracker-rs/imagewidget.cpp (limited to 'tracker-rs/imagewidget.cpp') 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 + * 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 + +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()); +} -- cgit v1.2.3