feat(isp_awb): support isp auto white balance

This commit is contained in:
laokaiyao
2024-06-24 10:49:20 +08:00
committed by Kevin (Lao Kaiyao)
parent 4b08ddb0f3
commit 8c225c0200
13 changed files with 901 additions and 4 deletions
+66 -1
View File
@@ -13,7 +13,9 @@
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "hal/isp_types.h"
#include "hal/hal_utils.h"
#ifdef __cplusplus
extern "C" {
@@ -60,7 +62,7 @@ void isp_hal_init(isp_hal_context_t *hal, int isp_id);
*
* @param[in] hal Context of the HAL layer
* @param[in] window_id Window ID
* @param[in] window Window info, see `isp_af_window_t`
* @param[in] window Window info, see `isp_window_t`
*/
void isp_hal_af_window_config(const isp_hal_context_t *hal, int window_id, const isp_window_t *window);
@@ -86,6 +88,69 @@ uint32_t isp_hal_check_clear_intr_event(const isp_hal_context_t *hal, uint32_t m
*/
void isp_hal_bf_config(isp_hal_context_t *hal, isp_hal_bf_cfg_t *config);
/*---------------------------------------------------------------
Color Correction Matrix
---------------------------------------------------------------*/
/**
* @brief Set Color Correction Matrix
*
* @param[in] hal Context of the HAL layer
* @param[in] saturation Whether to enable saturation when float data overflow
* @param[in] flt_matrix 3x3 RGB correction matrix
* @return
* - true Set success
* - false Invalid are
*/
bool isp_hal_ccm_set_matrix(const isp_hal_context_t *hal, bool saturation, const float flt_matrix[3][3]);
/*---------------------------------------------------------------
AWB
---------------------------------------------------------------*/
/**
* @brief Set the window of the AWB
*
* @param[in] hal Context of the HAL layer
* @param[in] win Pointer to the window of the AWB
* @return
* - true Set success
* - false Invalid arg
*/
bool isp_hal_awb_set_window_range(const isp_hal_context_t *hal, const isp_window_t *win);
/**
* @brief Set the luminance range of the white patch
*
* @param[in] hal Context of the HAL layer
* @param[in] lum_min Minimum luminance
* @param[in] lum_max Maximum luminance
* @return
* - true Set success
* - false Invalid arg
*/
bool isp_hal_awb_set_luminance_range(const isp_hal_context_t *hal, uint32_t lum_min, uint32_t lum_max);
/**
* @brief Set the R/G ratio of the white patch
*
* @param[in] hal Context of the HAL layer
* @param[in] rg_ratio_range Range of Red to Green ratio
* @return
* - true Set success
* - false Invalid arg
*/
bool isp_hal_awb_set_rg_ratio_range(const isp_hal_context_t *hal, float rg_min, float rg_max);
/**
* @brief Set the B/R ratio of the white patch
*
* @param[in] hal Context of the HAL layer
* @param[in] bg_ratio_range Range of Blue to Green ratio
* @return
* - true Set success
* - false Invalid arg
*/
bool isp_hal_awb_set_bg_ratio_range(const isp_hal_context_t *hal, float bg_min, float bg_max);
#ifdef __cplusplus
}
#endif
+14
View File
@@ -108,6 +108,20 @@ typedef enum {
ISP_BF_EDGE_PADDING_MODE_CUSTOM_DATA, ///< Fill BF edge padding data with custom pixel data
} isp_bf_edge_padding_mode_t;
/*---------------------------------------------------------------
AWB
---------------------------------------------------------------*/
/**
* @brief ISP AWB sample point in the ISP pipeline
*
*/
typedef enum {
ISP_AWB_SAMPLE_POINT_BEFORE_CCM, ///< Sample AWB data before CCM (Color Correction Matrix)
ISP_AWB_SAMPLE_POINT_AFTER_CCM, ///< Sample AWB data after CCM (Color Correction Matrix)
} isp_awb_sample_point_t;
#ifdef __cplusplus
}
#endif