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 <QWidget>
27 
29 
30 #include "Image/ByteImage.h"
31 #include <Math/Math2d.h>
32 
33 #include <mutex>
34 
35 namespace visionx
36 {
37 
39  public QWidget,
40  public armarx::Logging
41  {
42  Q_OBJECT
43  public:
44  ImageViewerArea(QWidget* parent = 0);
45  ~ImageViewerArea() override;
46 
47  void setImages(int numberImages, CByteImage** images, IceUtil::Time imageTimestamp, IceUtil::Time receiveTimestamp);
49 
51 
53 
54  public slots:
55 
56  signals:
57  protected slots:
58  void updateImage(long timeReceived);
59  protected:
60  void paintEvent(QPaintEvent* pPaintEvent) override;
61 
62  int getNumberImages();
63 
64  private:
65  int inputWidth;
66  int inputHeight;
67  int numberImages;
68  IceUtil::Time timeDisplayed;
69 
70  unsigned char* buffer;
71  std::mutex bufferMutex;
72  QImage scaledImage;
73  std::mutex imageMutex;
74  IceUtil::Time imageTimestamp;
75  IceUtil::Time receiveTimestamp;
76  IceUtil::Time displayDelay;
77  };
78 }
79 
80 
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::ImageViewerArea::updateImage
void updateImage(long timeReceived)
Definition: ImageViewerArea.cpp:130
visionx::ImageViewerArea::getTimeDisplayed
IceUtil::Time getTimeDisplayed() const
Definition: ImageViewerArea.cpp:75
GfxTL::Vec2d
VectorXD< 2, double > Vec2d
Definition: VectorXD.h:694
visionx::ImageViewerArea
Definition: ImageViewerArea.h:38
visionx::ImageViewerArea::setImages
void setImages(int numberImages, CByteImage **images, IceUtil::Time imageTimestamp, IceUtil::Time receiveTimestamp)
Definition: ImageViewerArea.cpp:80
visionx::ImageViewerArea::getDisplayDelay
IceUtil::Time getDisplayDelay() const
Definition: ImageViewerArea.cpp:70
visionx::ImageViewerArea::paintEvent
void paintEvent(QPaintEvent *pPaintEvent) override
Definition: ImageViewerArea.cpp:53
visionx::ImageViewerArea::~ImageViewerArea
~ImageViewerArea() override
Definition: ImageViewerArea.cpp:45
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
visionx::ImageViewerArea::getScaledImageDimensions
Vec2d getScaledImageDimensions()
Definition: ImageViewerArea.cpp:137
armarx::Logging
Base Class for all Logging classes.
Definition: Logging.h:232
visionx::ImageViewerArea::getNumberImages
int getNumberImages()
Definition: ImageViewerArea.cpp:65
Logging.h
visionx::ImageViewerArea::ImageViewerArea
ImageViewerArea(QWidget *parent=0)
Definition: ImageViewerArea.cpp:35