feat(cam): support format conversion function
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -39,6 +39,18 @@ typedef enum {
|
||||
CAM_CTLR_DATA_WIDTH_16 = 16, ///< 16-bit data width
|
||||
} cam_ctlr_data_width_t;
|
||||
|
||||
/**
|
||||
* @brief Camera Controller format conversion configuration
|
||||
*/
|
||||
typedef struct {
|
||||
cam_ctlr_color_t src_format; /*!< Source format */
|
||||
cam_ctlr_color_t dst_format; /*!< Destination format */
|
||||
color_conv_std_rgb_yuv_t conv_std; /*!< Conversion standard */
|
||||
uint32_t data_width; /*!< Data width in bits */
|
||||
color_range_t input_range; /*!< Input color range */
|
||||
color_range_t output_range; /*!< Output color range */
|
||||
} cam_ctlr_format_conv_config_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -68,6 +68,24 @@ void cam_hal_start_streaming(cam_hal_context_t *hal);
|
||||
*/
|
||||
void cam_hal_stop_streaming(cam_hal_context_t *hal);
|
||||
|
||||
/**
|
||||
* @brief Configure color format conversion
|
||||
*
|
||||
* This function handles all types of color format conversions:
|
||||
* - 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
|
||||
*
|
||||
* @param hal CAM HAL context pointer
|
||||
* @param config Color conversion configuration. If NULL, default config is used.
|
||||
*/
|
||||
void cam_hal_color_format_convert(cam_hal_context_t *hal,
|
||||
const cam_ctlr_format_conv_config_t *config);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user