nareshmlx/opencv-pr huggingface dataset:
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -304,6 +304,10 @@ OCV_OPTION(WITH_GTK "Include GTK support" ON
 OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF
   VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
   VERIFY HAVE_GTK AND NOT HAVE_GTK3)
+OCV_OPTION(WITH_FRAMEBUFFER "Include framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
+OCV_OPTION(WITH_FRAMEBUFFER_XVFB "Include virtual framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
 OCV_OPTION(WITH_WAYLAND "Include Wayland support" OFF
         VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
```

Review comment:
Please remove `VERIFY HAVE_FRAMEBUFFER` part, it does not work and probably is useless anyway.
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 7

**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.defines.hpp>
+#ifdef NDEBUG
+#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG + 1
```

Review comment:
Add license header: https://github.com/opencv/opencv/wiki/Coding_Style_Guide#file-structure
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 7

**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.defines.hpp>
+#ifdef NDEBUG
+#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG + 1
```

Review comment:
The first include should be `precomp.hpp`
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
Avoid indentation in namespaces.
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
> img, img There is no implementation for in-place processing. Performance is degraded. ``` { Mat bgra; cvtColor(img, bgra, COLOR_RGB2BGRA); img = bgra; } ```
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
Use the second parameter of `getConfigurationParameterString()` instead.
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
> INFO DEBUG or VERBOSE
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
`.rows` and `.cols`. Or better is `.empty()`. Also we should not eat problems silently, report them to the user. Also `.dims == 2` check should be added through `CV_CheckEQ`.
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
what is the difference from image.getMat()
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
data race is possible here. Why do we need such global variable?
**File:** modules/highgui/src/window_framebuffer.hpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 5

**Code Changes:**
```diff
@@ -0,0 +1,135 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#ifndef OPENCV_HIGHGUI_WINDOWS_FRAMEBUFFER_HPP
+#define OPENCV_HIGHGUI_WINDOWS_FRAMEBUFFER_HPP
+
+#include "backend.hpp"
+
+#include <linux/fb.h>
```

Review comment:
Add license header: https://github.com/opencv/opencv/wiki/Coding_Style_Guide#file-structure
**File:** modules/highgui/src/window_framebuffer.hpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,135 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#ifndef OPENCV_HIGHGUI_WINDOWS_FRAMEBUFFER_HPP
+#define OPENCV_HIGHGUI_WINDOWS_FRAMEBUFFER_HPP
+
+#include "backend.hpp"
+
```

Review comment:
No `CV_EXPORTS` for non-public API.
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 7

**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.defines.hpp>
+#ifdef NDEBUG
+#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG + 1
```

Review comment:
The manual specifies the url http://opencv.org/license.html The transition gives the error "Not found, error 404" The real way is https://opencv.org/license/ Which one should I specify in the source files?
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
If don't clone the image, the original image will be change (size and colorspase). Copy of the image is used to copy data into the framebuffer
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
currentImg local variable for Windows. currentImg is used to display the image when Windows is resized and moved.
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
Fixed all places of inplace transformations (lines 68-132 167-169)
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
Fixed it in two functions: static std::string& getFBMode() (line 41-42) static std::string& getFBFileName() (line 48-49)
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
All indicators that the method was called were replaced with CV_LOG_DEBUG
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
replaced with the following code if (currentImg.empty()) { CV_LOG_WARNING(NULL, "UI: image is empty"); return; } CV_CheckEQ(currentImg.dims, 2, "UI: dims != 2"); Additionally fixed comparison in methods resize and move (lines 285, 299) if (!currentImg.empty()) { imshow(currentImg); }
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,798 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
```

Review comment:
After the "inplace transformations" fix, clone is not needed
**File:** modules/highgui/src/window_framebuffer.hpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 5

**Code Changes:**
```diff
@@ -0,0 +1,135 @@
+// This file is part of OpenCV project.
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#ifndef OPENCV_HIGHGUI_WINDOWS_FRAMEBUFFER_HPP
+#define OPENCV_HIGHGUI_WINDOWS_FRAMEBUFFER_HPP
+
+#include "backend.hpp"
+
+#include <linux/fb.h>
```

Review comment:
license added (the problem with the URL remains)
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 7

**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.defines.hpp>
+#ifdef NDEBUG
+#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG + 1
```

Review comment:
Please use the one with wrong URL for consistency. I hope we can fix the website to make redirect to https version later.
**File:** modules/highgui/src/window_framebuffer.cpp
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 7

**Code Changes:**
```diff
+// It is subject to the license terms in the LICENSE file found in the top-level directory
+// of this distribution and at http://opencv.org/license.html.
+
+#include "precomp.hpp"
+
+#include "window_framebuffer.hpp"
+
+#include <opencv2/core/utils/configuration.private.hpp>
+#include <opencv2/core/utils/logger.defines.hpp>
+#ifdef NDEBUG
+#define CV_LOG_STRIP_LEVEL CV_LOG_LEVEL_DEBUG + 1
```

Review comment:
license added
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -304,6 +304,10 @@ OCV_OPTION(WITH_GTK "Include GTK support" ON
 OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF
   VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
   VERIFY HAVE_GTK AND NOT HAVE_GTK3)
+OCV_OPTION(WITH_FRAMEBUFFER "Include framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
+OCV_OPTION(WITH_FRAMEBUFFER_XVFB "Include virtual framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
 OCV_OPTION(WITH_WAYLAND "Include Wayland support" OFF
         VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
```

Review comment:
1. > HAVE_FRAMEBUFFER > HAVE_FRAMEBUFFER_XVFB Both are not set in CMake stripts. 2. > "YES" `HAVE_*` check should be used instead, see other cases. 3. Need to add report about XVFB option status.
**File:** modules/highgui/CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -49,6 +49,16 @@ list(REMOVE_ITEM highgui_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${n
 
 set(OPENCV_HIGHGUI_BUILTIN_BACKEND "")
 
+if(WITH_FRAMEBUFFER AND HAVE_FRAMEBUFFER)
+  set(OPENCV_HIGHGUI_BUILTIN_BACKEND "FB")
+  add_definitions(-DHAVE_FRAMEBUFFER)
+  list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.cpp)
+  list(APPEND highgui_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.hpp)
+  if(HAVE_FRAMEBUFFER_XVFB)
```

Review comment:
> FATAL_ERROR It is better to use `STATUS` message and emit the list of required pre-installed -dev packages.
**File:** modules/highgui/CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -49,6 +49,16 @@ list(REMOVE_ITEM highgui_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${n
 
 set(OPENCV_HIGHGUI_BUILTIN_BACKEND "")
 
+if(WITH_FRAMEBUFFER AND HAVE_FRAMEBUFFER)
+  set(OPENCV_HIGHGUI_BUILTIN_BACKEND "FB")
+  add_definitions(-DHAVE_FRAMEBUFFER)
+  list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.cpp)
+  list(APPEND highgui_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.hpp)
+  if(HAVE_FRAMEBUFFER_XVFB)
```

Review comment:
We prefer to minimize details in the module's CMake. Move this code to `cmake/detect_framebuffer.cmake` and use `add_backend`. `check_cxx_source_compiles` is not used in OpenCV code base. We prefer to use `try_compile()` instead.
**File:** modules/highgui/CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -49,6 +49,16 @@ list(REMOVE_ITEM highgui_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${n
 
 set(OPENCV_HIGHGUI_BUILTIN_BACKEND "")
 
+if(WITH_FRAMEBUFFER AND HAVE_FRAMEBUFFER)
+  set(OPENCV_HIGHGUI_BUILTIN_BACKEND "FB")
+  add_definitions(-DHAVE_FRAMEBUFFER)
+  list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.cpp)
+  list(APPEND highgui_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.hpp)
+  if(HAVE_FRAMEBUFFER_XVFB)
```

Review comment:
In which directory can I put the source code for try_compile() OpenCV/cmake/checks ?
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -304,6 +304,10 @@ OCV_OPTION(WITH_GTK "Include GTK support" ON
 OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF
   VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
   VERIFY HAVE_GTK AND NOT HAVE_GTK3)
+OCV_OPTION(WITH_FRAMEBUFFER "Include framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
+OCV_OPTION(WITH_FRAMEBUFFER_XVFB "Include virtual framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
 OCV_OPTION(WITH_WAYLAND "Include Wayland support" OFF
         VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
```

Review comment:
1. The variables HAVE_FRAMEBUFFER and HAVE_FRAMEBUFFER_XVFB are set in modules/highgui/cmake/detect_framebuffer.cmake 2. 3. Added status explanation CMakeLists.txt (lines 1456-1470)
**File:** modules/highgui/CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -49,6 +49,16 @@ list(REMOVE_ITEM highgui_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${n
 
 set(OPENCV_HIGHGUI_BUILTIN_BACKEND "")
 
+if(WITH_FRAMEBUFFER AND HAVE_FRAMEBUFFER)
+  set(OPENCV_HIGHGUI_BUILTIN_BACKEND "FB")
+  add_definitions(-DHAVE_FRAMEBUFFER)
+  list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.cpp)
+  list(APPEND highgui_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.hpp)
+  if(HAVE_FRAMEBUFFER_XVFB)
```

Review comment:
Moved to modules/highgui/cmake/detect_framebuffer.cmake Replaced by STATUS
**File:** modules/highgui/CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -49,6 +49,16 @@ list(REMOVE_ITEM highgui_ext_hdrs "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${n
 
 set(OPENCV_HIGHGUI_BUILTIN_BACKEND "")
 
+if(WITH_FRAMEBUFFER AND HAVE_FRAMEBUFFER)
+  set(OPENCV_HIGHGUI_BUILTIN_BACKEND "FB")
+  add_definitions(-DHAVE_FRAMEBUFFER)
+  list(APPEND highgui_srcs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.cpp)
+  list(APPEND highgui_hdrs ${CMAKE_CURRENT_LIST_DIR}/src/window_framebuffer.hpp)
+  if(HAVE_FRAMEBUFFER_XVFB)
```

Review comment:
Added check cmake/checks/framebuffer.cpp And try_compile() at modules/highgui/cmake/detect_framebuffer.cmake
**File:** modules/highgui/cmake/init.cmake
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -39,6 +39,8 @@ endmacro()
 add_backend("gtk" WITH_GTK)
 add_backend("win32ui" WITH_WIN32UI)
 add_backend("wayland" WITH_WAYLAND)
+add_backend("framebuffer" WITH_FRAMEBUFFER)
+
 # TODO cocoa
 # TODO qt
 # TODO opengl
```

Review comment:
Only one line is expected here.
**File:** modules/highgui/cmake/detect_framebuffer.cmake
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,14 @@
+# --- FB ---
+set(HAVE_FRAMEBUFFER ON)
+if(WITH_FRAMEBUFFER_XVFB)
+  try_compile(HAVE_FRAMEBUFFER_XVFB
+    "${CMAKE_CURRENT_BINARY_DIR}"
+    "${OpenCV_SOURCE_DIR}/cmake/checks/framebuffer.cpp")
+  if(HAVE_FRAMEBUFFER_XVFB)
+    message(STATUS "Check virtual framebuffer - done")
+  else()
```

Review comment:
Don't clear these vars.
**File:** modules/highgui/cmake/detect_framebuffer.cmake
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -0,0 +1,14 @@
+# --- FB ---
+set(HAVE_FRAMEBUFFER ON)
+if(WITH_FRAMEBUFFER_XVFB)
+  try_compile(HAVE_FRAMEBUFFER_XVFB
+    "${CMAKE_CURRENT_BINARY_DIR}"
+    "${OpenCV_SOURCE_DIR}/cmake/checks/framebuffer.cpp")
+  if(HAVE_FRAMEBUFFER_XVFB)
+    message(STATUS "Check virtual framebuffer - done")
+  else()
```

Review comment:
WITH_FRAMEBUFFER is already checked in `add_backend()` macro.
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -304,6 +304,10 @@ OCV_OPTION(WITH_GTK "Include GTK support" ON
 OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF
   VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
   VERIFY HAVE_GTK AND NOT HAVE_GTK3)
+OCV_OPTION(WITH_FRAMEBUFFER "Include framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
+OCV_OPTION(WITH_FRAMEBUFFER_XVFB "Include virtual framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
 OCV_OPTION(WITH_WAYLAND "Include Wayland support" OFF
         VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
```

Review comment:
No need to extra `if` blocks. Just take a look on the lines below this inserted code.
**File:** modules/highgui/cmake/detect_framebuffer.cmake
**Change Type:** added
**Context:** PR #25661: Highgui backend on top of Framebuffer
**Review Line:** 6

**Code Changes:**
```diff
+# --- FB ---
+set(HAVE_FRAMEBUFFER ON)
+if(WITH_FRAMEBUFFER_XVFB)
+  try_compile(HAVE_FRAMEBUFFER_XVFB
+    "${CMAKE_CURRENT_BINARY_DIR}"
+    "${OpenCV_SOURCE_DIR}/cmake/checks/framebuffer.cpp")
+  if(HAVE_FRAMEBUFFER_XVFB)
+    message(STATUS "Check virtual framebuffer - done")
+  else()
+    message(STATUS
+      "Check virtual framebuffer - failed\n"
```

Review comment:
add 4 spaces indentation for shifted parameters to keep code readable,
**File:** CMakeLists.txt
**Change Type:** modified
**Context:** PR #25661: Highgui backend on top of Framebuffer

**Code Changes:**
```diff
@@ -304,6 +304,10 @@ OCV_OPTION(WITH_GTK "Include GTK support" ON
 OCV_OPTION(WITH_GTK_2_X "Use GTK version 2" OFF
   VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
   VERIFY HAVE_GTK AND NOT HAVE_GTK3)
+OCV_OPTION(WITH_FRAMEBUFFER "Include framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
+OCV_OPTION(WITH_FRAMEBUFFER_XVFB "Include virtual framebuffer support" OFF
+  VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID)
 OCV_OPTION(WITH_WAYLAND "Include Wayland support" OFF
         VISIBLE_IF UNIX AND NOT APPLE AND NOT ANDROID
```

Review comment:
FRAMEBUFFER_XVFB is not a dedicated feature - it is a build variant of `FRAMEBUFFER`.