Skip to content

Commit 40292d1

Browse files
committed
update docs
1 parent 7ea4b5d commit 40292d1

File tree

2 files changed

+122
-28
lines changed

2 files changed

+122
-28
lines changed

docs_espressif/en/debugproject.rst

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -346,43 +346,90 @@ You can start a monitor session to capture fatal error events with **ESP-IDF: La
346346
ESP-IDF: Image Viewer
347347
---------------------
348348

349-
The ESP-IDF extension provides an **ESP-IDF: Image Viewer** feature that allows you to visualize binary image data from debug variables during a debugging session. This is particularly useful for applications that work with camera sensors, display buffers, or any raw image data.
349+
The ESP-IDF extension provides an **ESP-IDF: Image Viewer** feature that allows you to visualize binary image data from debug variables during a debugging session. This is particularly useful for applications that work with camera sensors, display buffers, LVGL graphics, OpenCV computer vision, or any raw image data.
350350

351-
To use the Image Viewer:
351+
**Quick Access Methods:**
352352

353-
1. Start a debug session and pause at a breakpoint where your image data variable is in scope
354-
2. Go to ``View`` > ``Command Palette`` and enter ``ESP-IDF: Open Image Viewer``
355-
3. In the Image Viewer panel, enter the name of your image data variable and its size
356-
4. Select the appropriate image format and dimensions
357-
5. Click ``Load Image`` to visualize the data
353+
1. **Right-click on variables in the debug session:**
354+
- Right-click on any ``lv_image_dsc_t`` variable and select ``View as LVGL Image``
355+
- Right-click on any ``cv::Mat`` variable and select ``View as OpenCV Image``
356+
357+
2. **Manual Image Viewer:**
358+
- Go to ``View`` > ``Command Palette`` and enter ``ESP-IDF: Open Image Viewer``
359+
- Enter the name of your image data variable and its size
360+
- Select the appropriate image format and dimensions
361+
- Click ``Load Image`` to visualize the data
358362

359363
**Supported Image Formats:**
364+
365+
**LVGL Color Formats (lv_color_format_t):**
366+
- RGB565, RGB888, RGBA8888, ARGB8888, XRGB8888
367+
- BGR888, BGRA8888, ABGR8888, XBGR8888
368+
- RGB332, RGB444, RGB555, RGB666, RGB777
369+
- Grayscale, YUV420, YUV422, YUV444
370+
- And many more LVGL-specific formats
371+
372+
**OpenCV Mat Formats:**
373+
- BGR888 (3 channels)
374+
- BGRA8888 (4 channels)
375+
- Grayscale (1 channel)
376+
377+
**Raw Pixel Formats:**
360378
- RGB565 (16-bit per pixel)
361379
- RGB888 (24-bit per pixel)
362380
- Grayscale (8-bit per pixel)
363381
- YUV420, YUV422, YUV444 (various YUV formats)
364382

365383
**Example Usage:**
366384

367-
Consider a camera application with the following variable:
385+
**LVGL Image Example:**
386+
387+
.. code-block:: C
388+
389+
// LVGL image descriptor
390+
lv_image_dsc_t my_image = {
391+
.header = {
392+
.cf = LV_COLOR_FORMAT_RGB888, // Color format
393+
.w = 320, // Width
394+
.h = 240 // Height
395+
},
396+
.data_size = 320 * 240 * 3, // Data size in bytes
397+
.data = image_data // Pointer to image data
398+
};
399+
400+
During debugging, right-click on ``my_image`` and select ``View as LVGL Image``. The Image Viewer will automatically extract the format, dimensions, and data from the LVGL structure.
401+
402+
**OpenCV Mat Example:**
403+
404+
.. code-block:: C
405+
406+
cv::Mat image(240, 320, CV_8UC3); // 320x240 BGR888 image
407+
// ... populate image data ...
408+
409+
During debugging, right-click on ``image`` and select ``View as OpenCV Image``. The Image Viewer will automatically extract the dimensions, format, and data from the OpenCV Mat structure.
410+
411+
**Manual Raw Data Example:**
368412

369413
.. code-block:: C
370414
371415
uint8_t image_buffer[320 * 240 * 3]; // RGB888 format, 320x240 pixels
372416
size_t image_size = sizeof(image_buffer);
373417
374-
During debugging, you can:
418+
For manual usage:
375419
- Enter ``image_buffer`` as the variable name
376420
- Enter ``image_size`` or ``230400`` (320 * 240 * 3) as the size
377421
- Select ``RGB888`` format
378422
- Set width to ``320`` and height to ``240``
379423

380424
**Important Notes:**
381-
- The Image Viewer only supports raw pixel formats. Compressed formats (JPEG, PNG, etc.) are not supported
382-
- You must specify the correct size of the image data array
383-
- The size can be provided as a number (bytes) or as the name of another variable containing the size
384-
- For pointer variables, make sure to provide the actual data size, not the pointer size
385-
- The Image Viewer automatically estimates dimensions based on the data size and selected format, but you can manually adjust them for better results
425+
- **LVGL Support**: Automatically extracts image properties from ``lv_image_dsc_t`` structures
426+
- **OpenCV Support**: Automatically extracts image properties from ``cv::Mat`` objects
427+
- **Format Detection**: The Image Viewer automatically detects and maps LVGL and OpenCV formats to the appropriate display format
428+
- **Raw Data**: The Image Viewer supports raw pixel formats. Compressed formats (JPEG, PNG, etc.) are not supported
429+
- **Size Specification**: For manual usage, you must specify the correct size of the image data array
430+
- **Variable Size**: The size can be provided as a number (bytes) or as the name of another variable containing the size
431+
- **Pointer Variables**: For pointer variables, make sure to provide the actual data size, not the pointer size
432+
- **Auto-Dimensioning**: The Image Viewer automatically estimates dimensions based on the data size and selected format, but you can manually adjust them for better results
386433

387434

388435
Other extensions debug configuration

docs_espressif/zh_CN/debugproject.rst

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -218,40 +218,87 @@ ESP-IDF 扩展在 ``运行和调试`` 视图中提供了 ``ESP-IDF:外设视
218218
ESP-IDF:图像查看器
219219
--------------------
220220

221-
ESP-IDF 扩展提供了 **ESP-IDF:图像查看器** 功能,允许你在调试会话期间可视化来自调试变量的二进制图像数据。这对于处理摄像头传感器、显示缓冲区或任何原始图像数据的应用程序特别有用
221+
ESP-IDF 扩展提供了 **ESP-IDF:图像查看器** 功能,允许你在调试会话期间可视化来自调试变量的二进制图像数据。这对于处理摄像头传感器、显示缓冲区、LVGL 图形、OpenCV 计算机视觉或任何原始图像数据的应用程序特别有用
222222

223-
使用方法:
223+
**快速访问方法:**
224224

225-
1. 启动调试会话并在图像数据变量作用域内的断点处暂停
226-
2. 点击 ``查看`` > ``命令面板``,输入 ``ESP-IDF:打开图像查看器``
227-
3. 在图像查看器面板中,输入图像数据变量的名称和大小
228-
4. 选择适当的图像格式和尺寸
229-
5. 点击 ``加载图像`` 来可视化数据
225+
1. **在调试会话中右键点击变量:**
226+
- 右键点击任何 ``lv_image_dsc_t`` 变量并选择 ``以 LVGL 图像查看``
227+
- 右键点击任何 ``cv::Mat`` 变量并选择 ``以 OpenCV 图像查看``
228+
229+
2. **手动图像查看器:**
230+
- 点击 ``查看`` > ``命令面板``,输入 ``ESP-IDF:打开图像查看器``
231+
- 输入图像数据变量的名称和大小
232+
- 选择适当的图像格式和尺寸
233+
- 点击 ``加载图像`` 来可视化数据
230234

231235
**支持的图像格式:**
236+
237+
**LVGL 颜色格式 (lv_color_format_t):**
238+
- RGB565、RGB888、RGBA8888、ARGB8888、XRGB8888
239+
- BGR888、BGRA8888、ABGR8888、XBGR8888
240+
- RGB332、RGB444、RGB555、RGB666、RGB777
241+
- 灰度图、YUV420、YUV422、YUV444
242+
- 以及更多 LVGL 特定格式
243+
244+
**OpenCV Mat 格式:**
245+
- BGR888(3 通道)
246+
- BGRA8888(4 通道)
247+
- 灰度图(1 通道)
248+
249+
**原始像素格式:**
232250
- RGB565(每像素 16 位)
233251
- RGB888(每像素 24 位)
234252
- 灰度图(每像素 8 位)
235253
- YUV420、YUV422、YUV444(各种 YUV 格式)
236254

237255
**使用示例:**
238256

239-
考虑一个具有以下变量的摄像头应用程序:
257+
**LVGL 图像示例:**
258+
259+
.. code-block:: C
260+
261+
// LVGL 图像描述符
262+
lv_image_dsc_t my_image = {
263+
.header = {
264+
.cf = LV_COLOR_FORMAT_RGB888, // 颜色格式
265+
.w = 320, // 宽度
266+
.h = 240 // 高度
267+
},
268+
.data_size = 320 * 240 * 3, // 数据大小(字节)
269+
.data = image_data // 指向图像数据的指针
270+
};
271+
272+
在调试过程中,右键点击 ``my_image`` 并选择 ``以 LVGL 图像查看``。图像查看器将自动从 LVGL 结构中提取格式、尺寸和数据。
273+
274+
**OpenCV Mat 示例:**
275+
276+
.. code-block:: C
277+
278+
cv::Mat image(240, 320, CV_8UC3); // 320x240 BGR888 图像
279+
// ... 填充图像数据 ...
280+
281+
在调试过程中,右键点击 ``image`` 并选择 ``以 OpenCV 图像查看``。图像查看器将自动从 OpenCV Mat 结构中提取尺寸、格式和数据。
282+
283+
**手动原始数据示例:**
240284

241285
.. code-block:: C
242286
243287
uint8_t image_buffer[320 * 240 * 3]; // RGB888 格式,320x240 像素
244288
size_t image_size = sizeof(image_buffer);
245289
246-
在调试过程中,你可以
290+
手动使用时
247291
- 输入 ``image_buffer`` 作为变量名
248292
- 输入 ``image_size`` 或 ``230400``(320 * 240 * 3)作为大小
249293
- 选择 ``RGB888`` 格式
250294
- 将宽度设置为 ``320``,高度设置为 ``240``
251295

252296
**重要说明:**
253-
- 图像查看器仅支持原始像素格式。不支持压缩格式(JPEG、PNG 等)
254-
- 必须指定图像数据数组的正确大小
255-
- 大小可以作为数字(字节)提供,或作为包含大小的另一个变量的名称
256-
- 对于指针变量,请确保提供实际数据大小,而不是指针大小
257-
- 图像查看器会根据数据大小和所选格式自动估算尺寸,但你可以手动调整以获得更好的结果
297+
- **LVGL 支持**:自动从 ``lv_image_dsc_t`` 结构中提取图像属性
298+
- **OpenCV 支持**:自动从 ``cv::Mat`` 对象中提取图像属性
299+
- **格式检测**:图像查看器自动检测并将 LVGL 和 OpenCV 格式映射到适当的显示格式
300+
- **原始数据**:图像查看器支持原始像素格式。不支持压缩格式(JPEG、PNG 等)
301+
- **大小指定**:手动使用时,必须指定图像数据数组的正确大小
302+
- **变量大小**:大小可以作为数字(字节)提供,或作为包含大小的另一个变量的名称
303+
- **指针变量**:对于指针变量,请确保提供实际数据大小,而不是指针大小
304+
- **自动尺寸估算**:图像查看器会根据数据大小和所选格式自动估算尺寸,但你可以手动调整以获得更好的结果

0 commit comments

Comments
 (0)