ImageViewerArea.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package ArmarX::
17* @author Kai Welke ( welke at kit dot edu)
18* @date 2012
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
25// ArmarX includes
26#include <mutex>
27
28#include <QWidget>
29
31
32#include "Image/ByteImage.h"
33#include <Math/Math2d.h>
34
35namespace visionx
36{
37
38 class ImageViewerArea : public QWidget, public armarx::Logging
39 {
40 Q_OBJECT
41 public:
42 ImageViewerArea(QWidget* parent = 0);
43 ~ImageViewerArea() override;
44
45 void setImages(int numberImages,
46 CByteImage** images,
47 IceUtil::Time imageTimestamp,
48 IceUtil::Time receiveTimestamp);
50
51 IceUtil::Time getTimeDisplayed() const;
52
53 IceUtil::Time getDisplayDelay() const;
54
55 public slots:
56
57 signals:
58 protected slots:
59 void updateImage(long timeReceived);
60
61 protected:
62 void paintEvent(QPaintEvent* pPaintEvent) override;
63
64 int getNumberImages();
65
66 private:
67 int inputWidth;
68 int inputHeight;
69 int numberImages;
70 IceUtil::Time timeDisplayed;
71
72 unsigned char* buffer;
73 std::mutex bufferMutex;
74 QImage scaledImage;
75 std::mutex imageMutex;
76 IceUtil::Time imageTimestamp;
77 IceUtil::Time receiveTimestamp;
78 IceUtil::Time displayDelay;
79 };
80} // namespace visionx
Base Class for all Logging classes.
Definition Logging.h:240
void updateImage(long timeReceived)
IceUtil::Time getDisplayDelay() const
IceUtil::Time getTimeDisplayed() const
void setImages(int numberImages, CByteImage **images, IceUtil::Time imageTimestamp, IceUtil::Time receiveTimestamp)
void paintEvent(QPaintEvent *pPaintEvent) override
ImageViewerArea(QWidget *parent=0)
ArmarX headers.