From 66f3e9745724d0a4b984d764ccf3298a13e69302 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Sat, 30 Oct 2021 10:57:47 +0000 Subject: [PATCH] highgui: drop invalid cvGetWindowImageRect --- .../include/opencv2/highgui/highgui_c.h | 5 ----- modules/highgui/src/window.cpp | 22 +++++++------------ 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/modules/highgui/include/opencv2/highgui/highgui_c.h b/modules/highgui/include/opencv2/highgui/highgui_c.h index 5d20b9501e..e508e14975 100644 --- a/modules/highgui/include/opencv2/highgui/highgui_c.h +++ b/modules/highgui/include/opencv2/highgui/highgui_c.h @@ -129,11 +129,6 @@ CVAPI(int) cvNamedWindow( const char* name, int flags CV_DEFAULT(CV_WINDOW_AUTOS CVAPI(void) cvSetWindowProperty(const char* name, int prop_id, double prop_value); CVAPI(double) cvGetWindowProperty(const char* name, int prop_id); -#ifdef __cplusplus // FIXIT remove in OpenCV 4.0 -/* Get window image rectangle coordinates, width and height */ -CVAPI(cv::Rect)cvGetWindowImageRect(const char* name); -#endif - /* display image within window (highgui windows remember their content) */ CVAPI(void) cvShowImage( const char* name, const CvArr* image ); diff --git a/modules/highgui/src/window.cpp b/modules/highgui/src/window.cpp index d9481de6da..481fee9fbd 100644 --- a/modules/highgui/src/window.cpp +++ b/modules/highgui/src/window.cpp @@ -399,13 +399,13 @@ CV_IMPL double cvGetWindowProperty(const char* name, int prop_id) #endif } -cv::Rect cvGetWindowImageRect(const char* name) +cv::Rect cv::getWindowImageRect(const String& winname) { CV_TRACE_FUNCTION(); - CV_Assert(name); + CV_Assert(!winname.empty()); { - auto window = findWindow_(name); + auto window = findWindow_(winname); if (window) { return window->getImageRect(); @@ -416,7 +416,7 @@ cv::Rect cvGetWindowImageRect(const char* name) auto backend = getCurrentUIBackend(); if (backend) { - CV_LOG_WARNING(NULL, "Can't find window with name: '" << name << "'. Do nothing"); + CV_LOG_WARNING(NULL, "Can't find window with name: '" << winname << "'. Do nothing"); CV_NOT_FOUND_DEPRECATION; } else @@ -427,13 +427,13 @@ cv::Rect cvGetWindowImageRect(const char* name) #else #if defined (HAVE_QT) - return cvGetWindowRect_QT(name); + return cvGetWindowRect_QT(winname.c_str()); #elif defined(HAVE_WIN32UI) - return cvGetWindowRect_W32(name); + return cvGetWindowRect_W32(winname.c_str()); #elif defined (HAVE_GTK) - return cvGetWindowRect_GTK(name); + return cvGetWindowRect_GTK(winname.c_str()); #elif defined (HAVE_COCOA) - return cvGetWindowRect_COCOA(name); + return cvGetWindowRect_COCOA(winname.c_str()); #else return Rect(-1, -1, -1, -1); #endif @@ -441,12 +441,6 @@ cv::Rect cvGetWindowImageRect(const char* name) #endif } -cv::Rect cv::getWindowImageRect(const String& winname) -{ - CV_TRACE_FUNCTION(); - return cvGetWindowImageRect(winname.c_str()); -} - void cv::namedWindow( const String& winname, int flags ) { CV_TRACE_FUNCTION();