1 /* 2 * Copyright (c) 2022 Rockchip Corporation 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 * 16 */ 17 18 #ifndef _RK_AIQ_SMART_IR_API_H_ 19 #define _RK_AIQ_SMART_IR_API_H_ 20 21 #include "common/rk_aiq_types.h" 22 23 typedef struct rk_aiq_sys_ctx_s rk_aiq_sys_ctx_t; 24 typedef struct rk_smart_ir_ctx_s rk_smart_ir_ctx_t; 25 26 RKAIQ_BEGIN_DECLARE 27 28 typedef enum RK_SMART_IR_STATUS_E { 29 RK_SMART_IR_STATUS_DAY, 30 RK_SMART_IR_STATUS_NIGHT, 31 } RK_SMART_IR_STATUS_t; 32 33 typedef struct rk_smart_ir_params_s { 34 float d2n_envL_th; 35 float n2d_envL_th; 36 float rggain_base; 37 float bggain_base; 38 float awbgain_rad; 39 float awbgain_dis; 40 uint16_t switch_cnts_th; 41 } rk_smart_ir_params_t; 42 43 typedef struct rk_smart_ir_result_s { 44 RK_SMART_IR_STATUS_t status; 45 } rk_smart_ir_result_t; 46 47 typedef struct rk_smart_ir_autoled_s { 48 bool is_smooth_convert; 49 float auto_irled_val; 50 float auto_irled_min; 51 float auto_irled_max; 52 } rk_smart_ir_autoled_t; 53 54 rk_smart_ir_ctx_t* rk_smart_ir_init(const rk_aiq_sys_ctx_t* ctx); 55 56 XCamReturn rk_smart_ir_deInit(const rk_smart_ir_ctx_t* ir_ctx); 57 58 XCamReturn rk_smart_ir_config(rk_smart_ir_ctx_t* ctx, rk_smart_ir_params_t* config); 59 60 XCamReturn rk_smart_ir_set_status(rk_smart_ir_ctx_t* ctx, rk_smart_ir_result_t result); 61 62 XCamReturn rk_smart_ir_runOnce(rk_smart_ir_ctx_t* ctx, rk_aiq_isp_stats_t* stats_ref, rk_smart_ir_result_t* result); 63 64 XCamReturn rk_smart_ir_auto_irled(rk_smart_ir_ctx_t* ctx, rk_smart_ir_autoled_t* auto_irled); 65 66 RKAIQ_END_DECLARE 67 68 #endif 69