overlay_image_display.h
Go to the documentation of this file.
1 // -*- mode: c++; -*-
2 /*********************************************************************
3  * Software License Agreement (BSD License)
4  *
5  * Copyright (c) 2014, JSK Lab
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of the JSK Lab nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *********************************************************************/
35 #ifndef JSK_RVIZ_PLUGIN_OVERLAY_IMAGE_DISPLAY_H_
36 #define JSK_RVIZ_PLUGIN_OVERLAY_IMAGE_DISPLAY_H_
37 
38 #ifndef Q_MOC_RUN
39 #include <rviz/display.h>
40 #include <OGRE/OgreTexture.h>
41 #include <OGRE/OgreColourValue.h>
42 #include <OGRE/OgreMaterial.h>
43 
44 #include <QPainter>
45 
51 
53 #include <sensor_msgs/Image.h>
54 
55 #include "overlay_utils.h"
57 #endif
58 
59 namespace jsk_rviz_plugins
60 {
62  {
63  Q_OBJECT
64  public:
66  virtual ~OverlayImageDisplay();
67 
68  // methods for OverlayPickerTool
69  virtual bool isInRegion(int x, int y);
70  virtual void movePosition(int x, int y);
71  virtual void setPosition(int x, int y);
72  virtual int getX() { return left_; };
73  virtual int getY() { return top_; };
74 
75  protected:
76  boost::mutex mutex_;
88  double alpha_;
89 #if ROS_VERSION_MINIMUM(1,12,0)
90  std::shared_ptr<image_transport::ImageTransport> it_;
91 #else
93 #endif
95  sensor_msgs::Image::ConstPtr msg_;
100 
101  virtual void redraw();
102  virtual void onInitialize();
103  virtual void onEnable();
104  virtual void onDisable();
105  virtual void update(float wall_dt, float ros_dt);
106  virtual void subscribe();
107  virtual void unsubscribe();
108  virtual void setImageSize();
109  virtual void processMessage(const sensor_msgs::Image::ConstPtr& msg);
110  protected Q_SLOTS:
111  void updateTopic();
112  void updateWidth();
113  void updateHeight();
114  void updateLeft();
115  void updateTop();
116  void updateAlpha();
117  void updateKeepAspectRatio();
118  void updateOverwriteAlpha();
119  };
120 
121 }
122 
123 #endif
virtual void processMessage(const sensor_msgs::Image::ConstPtr &msg)
ImageTransportHintsProperty * transport_hint_property_
x
y
boost::shared_ptr< image_transport::ImageTransport > it_
virtual void update(float wall_dt, float ros_dt)
rviz::RosTopicProperty * update_topic_property_


jsk_rviz_plugins
Author(s): Kei Okada , Yohei Kakiuchi , Shohei Fujii , Ryohei Ueda
autogenerated on Thu Jun 1 2023 02:45:58