From f2392f2e2f4254cd519f79e34b8e00ba036a0754 Mon Sep 17 00:00:00 2001 From: Yannick Verdie Date: Sun, 20 Jun 2010 11:18:23 +0000 Subject: [PATCH] New functions with QT GUI: - fix c++ wrapper - fix compilation bugs --- .../include/opencv2/highgui/highgui.hpp | 12 ++++---- .../include/opencv2/highgui/highgui_c.h | 3 -- modules/highgui/src/window.cpp | 28 +++++++++++++++---- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/modules/highgui/include/opencv2/highgui/highgui.hpp b/modules/highgui/include/opencv2/highgui/highgui.hpp index 3663a93a9d..1fda661ab3 100644 --- a/modules/highgui/include/opencv2/highgui/highgui.hpp +++ b/modules/highgui/include/opencv2/highgui/highgui.hpp @@ -56,19 +56,19 @@ namespace cv enum { WINDOW_AUTOSIZE=1 }; -//YV -//-----------New for QT -//CV_EXPORTS void information(const string& name, const string& text, int delayms); -//------------ - - CV_EXPORTS void namedWindow( const string& winname, int flags CV_DEFAULT(WINDOW_AUTOSIZE) ); CV_EXPORTS void destroyWindow( const string& winname ); CV_EXPORTS int startWindowThread(); CV_EXPORTS void setWindowProperty(const string& winname, int prop_id, double prop_value);//YV CV_EXPORTS double getWindowProperty(const string& winname, int prop_id);//YV + + +//Only for QT CV_EXPORTS void displayOverlay(const string& winname, const string& text, int delayms); +CV_EXPORTS int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]); +CV_EXPORTS void stopLoop(); + CV_EXPORTS void imshow( const string& winname, const Mat& mat ); diff --git a/modules/highgui/include/opencv2/highgui/highgui_c.h b/modules/highgui/include/opencv2/highgui/highgui_c.h index 2c5b61616d..8733e81905 100644 --- a/modules/highgui/include/opencv2/highgui/highgui_c.h +++ b/modules/highgui/include/opencv2/highgui/highgui_c.h @@ -208,9 +208,6 @@ CVAPI(void) cvConvertImage( const CvArr* src, CvArr* dst, int flags CV_DEFAULT(0 /* wait for key event infinitely (delay<=0) or for "delay" milliseconds */ CVAPI(int) cvWaitKey(int delay CV_DEFAULT(0)); -void cvInformation(const char* name, const char* text, int delay); - - /****************************************************************************************\ * Working with Video Files and Cameras * \****************************************************************************************/ diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index 6c3b8132e5..2ed0105975 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -135,11 +135,6 @@ double getWindowProperty(const string& winname, int prop_id) return cvGetWindowProperty(winname.c_str(),prop_id); } -void displayOverlay(const string& name, const string& text, int delayms) -{ - cvDisplayOverlay(name.c_str(),text.c_str(), delayms); -} - void imshow( const string& winname, const Mat& img ) { CvMat _img = img; @@ -179,6 +174,23 @@ int startWindowThread() return cvStartWindowThread(); } +#if defined (HAVE_QT) +void displayOverlay(const string& name, const string& text, int delayms) +{ + cvDisplayOverlay(name.c_str(),text.c_str(), delayms); +} + +int startLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]) +{ + return cvStartLoop(pt2Func, argc, argv); +} + +void stopLoop() +{ + cvStopLoop(); +} +#endif + } #if defined WIN32 || defined _WIN32 // see window_w32.cpp @@ -211,6 +223,12 @@ CV_IMPL int cvNamedWindow( const char*, int ) return -1; } +CV_IMPL int cvDisplayOverlay(const char* name, const char* text, int delayms) +{ + CV_NO_GUI_ERROR("cvNamedWindow"); + return -1; +} + CV_IMPL void cvDestroyWindow( const char* ) { CV_NO_GUI_ERROR( "cvDestroyWindow" );