Merge branch 'feat/dvp_format_trans_v5.5' into 'release/v5.5'

feat(cam): support format conversion function (v5.5)

See merge request espressif/esp-idf!41785
This commit is contained in:
morris
2025-10-27 15:04:35 +08:00
14 changed files with 256 additions and 3 deletions
@@ -114,6 +114,16 @@ Camera controller driver can be implemented in one of following ways:
After calling :cpp:func:`esp_cam_new_dvp_ctlr`, you should allocate a camera buffer that meets the alignment constraints, or call :cpp:func:`esp_cam_ctlr_alloc_buffer` to automatically allocate.
You can call :cpp:func:`esp_cam_ctlr_format_conversion` to configure format conversion. The driver supports the following conversion types:
* YUV to RGB conversion
* RGB to YUV conversion
* YUV to YUV conversion
Color range support:
* Full range: 0-255 for both RGB and YUV
* Limited range: RGB 16-240, YUV Y:16-240, U-V:16-235
.. code:: c
esp_cam_ctlr_handle_t cam_handle = NULL;
@@ -148,6 +158,16 @@ Camera controller driver can be implemented in one of following ways:
ESP_ERROR_CHECK(esp_cam_new_dvp_ctlr(&dvp_config, &cam_handle));
const cam_ctlr_format_conv_config_t conv_cfg = {
.src_format = CAM_CTLR_COLOR_YUV422, // Source format: YUV422
.dst_format = CAM_CTLR_COLOR_RGB565, // Destination format: RGB565
.conv_std = COLOR_CONV_STD_RGB_YUV_BT601,
.data_width = 8,
.input_range = COLOR_RANGE_LIMIT,
.output_range = COLOR_RANGE_LIMIT,
};
ESP_ERROR_CHECK(esp_cam_ctlr_format_conversion(cam_handle, &conv_cfg));
Uninstall Camera Controller Driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~