37 from python_qt_binding
import QT_BINDING_MODULES
39 not QT_BINDING_MODULES[
'QtCore'].__name__.startswith(
'PyQt5')
and 40 'PyQt5' in sys.modules
42 sys.modules[
'PyQt5'] =
None 43 from PIL.ImageQt
import ImageQt
45 from rqt_bag
import TopicMessageView
46 from rqt_bag_plugins
import image_helper
48 from python_qt_binding.QtGui
import QPixmap
49 from python_qt_binding.QtWidgets
import QGraphicsScene, QGraphicsView
60 super(ImageView, self).
__init__(timeline, parent, topic)
75 self._image_view.setScene(self.
_scene)
82 self._scene.setSceneRect(
83 0, 0, self._image_view.size().width() - 2, self._image_view.size().height() - 2)
90 TopicMessageView.message_viewed(self, bag, msg_details)
91 topic, msg, t = msg_details[:3]
95 self.
set_image(msg, topic, msg.header.stamp)
98 TopicMessageView.message_cleared(self)
104 resized_image = self._image.resize(
105 (self._image_view.size().width() - 2, self._image_view.size().height() - 2), self.
quality)
107 QtImage = ImageQt(resized_image)
108 pixmap = QPixmap.fromImage(QtImage)
110 self._scene.addPixmap(pixmap)
112 def set_image(self, image_msg, image_topic, image_stamp):
115 self.
_image = image_helper.imgmsg_to_pil(image_msg)
def set_image(self, image_msg, image_topic, image_stamp)
def message_cleared(self)
def put_image_into_scene(self)
def __init__(self, timeline, parent, topic)
def _resizeEvent(self, event)
def message_viewed(self, bag, msg_details)