Merge pull request #19467 from alalek:hotfix_19411

This commit is contained in:
Alexander Alekhin 2021-02-06 00:42:26 +00:00
commit a9c954e821
5 changed files with 15 additions and 30 deletions

View File

@ -297,7 +297,17 @@ int cv::waitKey(int delay)
return (code != -1) ? (code & 0xff) : -1; return (code != -1) ? (code & 0xff) : -1;
} }
// NOTE: cv::pollKey has no C API equivalent. it is implemented in each backend source file. #if defined(HAVE_WIN32UI)
// pollKey() implemented in window_w32.cpp
#elif defined(HAVE_GTK) || defined(HAVE_COCOA) || defined(HAVE_QT) || (defined (WINRT) && !defined (WINRT_8_0))
// pollKey() fallback implementation
int cv::pollKey()
{
CV_TRACE_FUNCTION();
// fallback. please implement a proper polling function
return cvWaitKey(1);
}
#endif
int cv::createTrackbar(const String& trackbarName, const String& winName, int cv::createTrackbar(const String& trackbarName, const String& winName,
int* value, int count, TrackbarCallback callback, int* value, int count, TrackbarCallback callback,
@ -789,6 +799,10 @@ CV_IMPL int cvCreateButton(const char*, void (*)(int, void*), void*, int, int)
CV_NO_GUI_ERROR("cvCreateButton"); CV_NO_GUI_ERROR("cvCreateButton");
} }
int cv::pollKey()
{
CV_NO_GUI_ERROR("cv::pollKey()");
}
#endif #endif

View File

@ -382,13 +382,6 @@ CV_IMPL int cvWaitKey(int delay)
} }
int cv::pollKey()
{
CV_TRACE_FUNCTION();
// fallback. please implement a proper polling function
return cvWaitKey(1);
}
//Yannick Verdie //Yannick Verdie
//This function is experimental and some functions (such as cvSet/getWindowProperty will not work) //This function is experimental and some functions (such as cvSet/getWindowProperty will not work)
//We recommend not using this function for now //We recommend not using this function for now

View File

@ -632,13 +632,6 @@ CV_IMPL int cvWaitKey (int maxWait)
return returnCode; return returnCode;
} }
int cv::pollKey()
{
CV_TRACE_FUNCTION();
// fallback. please implement a proper polling function
return cvWaitKey(1);
}
CvRect cvGetWindowRect_COCOA( const char* name ) CvRect cvGetWindowRect_COCOA( const char* name )
{ {
CvRect result = cvRect(-1, -1, -1, -1); CvRect result = cvRect(-1, -1, -1, -1);

View File

@ -1950,13 +1950,6 @@ CV_IMPL int cvWaitKey( int delay )
return last_key; return last_key;
} }
int cv::pollKey()
{
CV_TRACE_FUNCTION();
// fallback. please implement a proper polling function
return cvWaitKey(1);
}
#endif // HAVE_GTK #endif // HAVE_GTK
#endif // _WIN32 #endif // _WIN32

View File

@ -205,14 +205,6 @@ CV_IMPL int cvGetTrackbarPos(const char* trackbar_name, const char* window_name)
/********************************** Not YET implemented API ****************************************************/ /********************************** Not YET implemented API ****************************************************/
int cv::pollKey()
{
CV_TRACE_FUNCTION();
CV_WINRT_NO_GUI_ERROR("cvPollKey");
// TODO: implement appropriate logic here
}
CV_IMPL int cvWaitKey(int delay) CV_IMPL int cvWaitKey(int delay)
{ {
CV_WINRT_NO_GUI_ERROR("cvWaitKey"); CV_WINRT_NO_GUI_ERROR("cvWaitKey");