00001 #include <qthread.h> 00002 #include "Image/Image.H" 00003 #include "Qt/ImageCanvas.h" 00004 #include "Qt/ui/RobotHeadForm.h" 00005 00006 00007 class DispThread : public QThread 00008 { 00009 public: 00010 void init(nub::soft_ref<FrameIstream> gb, 00011 ImageCanvas *rightDisp, ImageCanvas *leftDisp); 00012 void run(); 00013 00014 private: 00015 nub::soft_ref<FrameIstream> itsGb; 00016 ImageCanvas* itsRightDisp; 00017 ImageCanvas* itsLeftDisp; 00018 bool stop; 00019 00020 }; 00021 00022 void DispThread::init(nub::soft_ref<FrameIstream> gb, 00023 ImageCanvas *rightDisp, ImageCanvas *leftDisp) 00024 { 00025 itsGb = gb; 00026 itsRightDisp = rightDisp; 00027 itsLeftDisp = leftDisp; 00028 stop = false; 00029 } 00030 void DispThread::run() 00031 { 00032 printf("Start\n"); 00033 while(!stop) 00034 { 00035 Image<PixRGB<byte> > img = itsGb->readRGB(); 00036 //itsRightDisp->setImage(img); 00037 // itsLeftDisp->setImage(img); 00038 } 00039 printf("Stop\n"); 00040 } 00041