00001 /* 00002 * VisionGUI.qt.C 00003 * 00004 * Description: This class interacts with ICE to receive messages 00005 * from the image processing components. Right now it only interfaces 00006 * with the Retina (to add other ones in, you need to define your 00007 * ICE message, edit the menu so that you can specify whether or not 00008 * to overlay your stuff). Also, this is a VisionBrainComponentI as 00009 * we are listening to the RetinaMessages for the images to display. 00010 * 00011 * 00012 * TODO: 1) Integrate with ObjectFinder 00013 * TODO: 2) Add a FrameRate submenu to the file menu and have it change 00014 * the VBCI's framerate variable. 00015 * 00016 */ 00017 00018 #include "Robots/BeoHawk/gui/VisionGUI.qt.H" 00019 #include "QtUtil/ImageConvert4.H" 00020 00021 VisionGUI::VisionGUI(OptionManager &mgr, 00022 const std::string &descrName, const std::string &tagName) : 00023 VisionBrainComponentI(mgr, descrName, tagName) { 00024 00025 ui.setupUi(this); 00026 connect (ui.actionExit, SIGNAL(triggered()), this, SLOT(close())); 00027 connect (this, SIGNAL(imageReady()), this, SLOT(updateImageLabel())); 00028 connect (ui.actionSave_Frame_as_Image, SIGNAL(triggered()), this, SLOT(saveImage())); 00029 } 00030 00031 VisionGUI::~VisionGUI() { 00032 } 00033 00034 void VisionGUI::registerTopics() { 00035 00036 LINFO("Registering VisionGUI Messages/Subscriptions"); 00037 registerVisionTopics(); 00038 } 00039 00040 void VisionGUI::updateFrame(Image<PixRGB<byte> > img, bool isFwdCamera) { 00041 00042 cleanImage = img; 00043 if (!ui.actionFreeze_Frame->isChecked()) { 00044 curImage = convertToQImage4(img); 00045 emit imageReady(); 00046 } 00047 }