You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs_espressif/en/debugproject.rst
+61-14Lines changed: 61 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -346,43 +346,90 @@ You can start a monitor session to capture fatal error events with **ESP-IDF: La
346
346
ESP-IDF: Image Viewer
347
347
---------------------
348
348
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.
350
350
351
-
To use the Image Viewer:
351
+
**Quick Access Methods:**
352
352
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
358
362
359
363
**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:**
360
378
- RGB565 (16-bit per pixel)
361
379
- RGB888 (24-bit per pixel)
362
380
- Grayscale (8-bit per pixel)
363
381
- YUV420, YUV422, YUV444 (various YUV formats)
364
382
365
383
**Example Usage:**
366
384
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.
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.
- Enter ``image_size`` or ``230400`` (320 * 240 * 3) as the size
377
421
- Select ``RGB888`` format
378
422
- Set width to ``320`` and height to ``240``
379
423
380
424
**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
0 commit comments