1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

highgui(pollKey): properly handle no-GUI case

This commit is contained in:
Alexander Alekhin
2021-02-05 23:50:42 +00:00
parent 9d227641c9
commit b6933dbf3a
5 changed files with 15 additions and 30 deletions
+15 -1
View File
@@ -297,7 +297,17 @@ int cv::waitKey(int delay)
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* 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");
}
int cv::pollKey()
{
CV_NO_GUI_ERROR("cv::pollKey()");
}
#endif