00001 #pragma once 00002 00003 // Qt includes 00004 #include <QtCore/QObject> 00005 00006 // forwared declarations 00007 class MainProgram; 00008 class MainWindow; 00009 class Snake; 00010 class QImage; 00011 class QPoint; 00012 00013 // OpenCV includes 00014 #ifdef _CH_ 00015 #pragma package <opencv> 00016 #endif 00017 00018 #ifndef _EiC 00019 #include "cv.h" 00020 #include "highgui.h" 00021 #endif 00022 00024 00034 class QtCvWrapper : public QObject 00035 { 00036 Q_OBJECT; 00037 00038 public: 00040 QtCvWrapper(MainProgram* parent, MainWindow* gui); 00042 ~QtCvWrapper(void); 00043 00045 inline bool iterate(){return m_iterate;}; 00047 inline bool step(){return m_step;}; 00048 00049 public slots: 00051 void slotImageOpened(); 00053 void slotSnakeButtonPressed(); 00055 void slotTest(); 00057 void slotInitCurve(); 00059 void slotIterationOn(); 00061 void slotIterationOff(); 00063 void slotIterationStep(); 00064 00065 00066 private: 00068 void createTestImage(CvPoint center, CvSize axes, CvScalar color, CvScalar background); 00069 00071 void convertImage(IplImage* src, QImage* dst); 00072 00074 CvPoint* createEllipse(QPoint ulPt, QPoint lrPt, int numSegments); 00075 00076 MainProgram* m_parent; 00077 MainWindow* m_gui; 00078 Snake* m_snake; 00079 IplImage* m_iplImg; 00080 00081 bool m_iterate; 00082 bool m_step; 00083 00084 };