image_enhancer.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011, Dirk Thomas, TU Darmstadt
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  * * Redistributions in binary form must reproduce the above
12  * copyright notice, this list of conditions and the following
13  * disclaimer in the documentation and/or other materials provided
14  * with the distribution.
15  * * Neither the name of the TU Darmstadt nor the names of its
16  * contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
29  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 #ifndef rqt_image_Enhancer__ImageEnhancer_H
34 #define rqt_image_Enhancer__ImageEnhancer_H
35 
36 #include <rqt_gui_cpp/plugin.h>
37 
38 #include <ui_image_enhancer.h>
39 
41 #include <sensor_msgs/Image.h>
42 
43 #include <opencv2/core/core.hpp>
44 
45 #include <QImage>
46 #include <QList>
47 #include <QMutex>
48 #include <QString>
49 #include <QSize>
50 #include <QWidget>
51 
52 #include <vector>
53 
54 namespace rqt_image_enhancer {
55 
57  : public rqt_gui_cpp::Plugin
58 {
59 
60  Q_OBJECT
61 
62 public:
63 
64  ImageEnhancer();
65 
66  virtual void initPlugin(qt_gui_cpp::PluginContext& context);
67 
68  virtual bool eventFilter(QObject* watched, QEvent* event);
69 
70  virtual void shutdownPlugin();
71 
72  virtual void saveSettings(qt_gui_cpp::Settings& plugin_settings, qt_gui_cpp::Settings& instance_settings) const;
73 
74  virtual void restoreSettings(const qt_gui_cpp::Settings& plugin_settings, const qt_gui_cpp::Settings& instance_settings);
75 
76 protected slots:
77 
78  virtual void updateTopicList();
79 
80 protected:
81 
82  virtual QList<QString> getTopicList(const QSet<QString>& message_types, const QList<QString>& transports);
83 
84  virtual void selectTopic(const QString& topic);
85 
86 protected slots:
87 
88  virtual void onTopicChanged(int index);
89 
90  virtual void onZoom1(bool checked);
91 
92  virtual void onDynamicRange(bool checked);
93 
94  virtual void onSelectionInProgress(QPoint p1, QPoint p2);
95 
96  virtual void onSelectionFinished(QPoint p1, QPoint p2);
97 
98  virtual void onRemoveSelection();
99 
100 protected:
101 
102  virtual void callbackImage(const sensor_msgs::Image::ConstPtr& msg);
103 
104  virtual void enforceSelectionConstraints(QPoint & p);
105 
106  Ui::ImageEnhancerWidget ui_;
107 
108  QWidget* widget_;
109 
111 
112  QImage qimage_;
114 
116 
117  QRect selection_;
120 
121  bool selected_;
122 
123 };
124 
125 }
126 
127 #endif // rqt_image_enhancer__ImageEnhancer_H
virtual void saveSettings(qt_gui_cpp::Settings &plugin_settings, qt_gui_cpp::Settings &instance_settings) const
virtual void onSelectionFinished(QPoint p1, QPoint p2)
virtual void initPlugin(qt_gui_cpp::PluginContext &context)
virtual void onZoom1(bool checked)
virtual void selectTopic(const QString &topic)
image_transport::Subscriber subscriber_
virtual void onDynamicRange(bool checked)
virtual bool eventFilter(QObject *watched, QEvent *event)
virtual void callbackImage(const sensor_msgs::Image::ConstPtr &msg)
virtual void restoreSettings(const qt_gui_cpp::Settings &plugin_settings, const qt_gui_cpp::Settings &instance_settings)
Ui::ImageEnhancerWidget ui_
virtual void enforceSelectionConstraints(QPoint &p)
virtual QList< QString > getTopicList(const QSet< QString > &message_types, const QList< QString > &transports)
virtual void onSelectionInProgress(QPoint p1, QPoint p2)
virtual void onTopicChanged(int index)


hector_rqt_plugins
Author(s): Dirk Thomas, Thorsten Graber, Gregor Gebhardt
autogenerated on Mon Jun 10 2019 13:36:34