1 /*
2  * Copyright (c) 2019-2022 Rockchip Eletronics Co., Ltd.
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 #include "again2/rk_aiq_uapi_camgroup_again_int_v2.h"
18 #include "rk_aiq_types_camgroup_again_prvt_v2.h"
19 
20 #if 1
21 #define ACNRV2_CHROMA_SF_STRENGTH_MAX_PERCENT (100.0)
22 
23 
24 XCamReturn
rk_aiq_uapi_camgroup_againV2_SetAttrib(RkAiqAlgoContext * ctx,const rk_aiq_gain_attrib_v2_t * attr,bool need_sync)25 rk_aiq_uapi_camgroup_againV2_SetAttrib(RkAiqAlgoContext *ctx,
26                                        const rk_aiq_gain_attrib_v2_t *attr,
27                                        bool need_sync)
28 {
29     CamGroup_AgainV2_Contex_t *pGroupCtx = (CamGroup_AgainV2_Contex_t *)ctx;
30     Again_Context_V2_t* pCtx = pGroupCtx->again_contex_v2;
31 
32     pCtx->eMode = attr->eMode;
33     if(pCtx->eMode == AGAINV2_OP_MODE_AUTO) {
34         pCtx->stAuto = attr->stAuto;
35     } else if(pCtx->eMode == AGAINV2_OP_MODE_MANUAL) {
36         pCtx->stManual.stSelect = attr->stManual.stSelect;
37     }
38     pCtx->isReCalculate |= 1;
39 
40     return XCAM_RETURN_NO_ERROR;
41 }
42 
43 XCamReturn
rk_aiq_uapi_camgroup_againV2_GetAttrib(const RkAiqAlgoContext * ctx,rk_aiq_gain_attrib_v2_t * attr)44 rk_aiq_uapi_camgroup_againV2_GetAttrib(const RkAiqAlgoContext *ctx,
45                                        rk_aiq_gain_attrib_v2_t *attr)
46 {
47 
48     CamGroup_AgainV2_Contex_t *pGroupCtx = (CamGroup_AgainV2_Contex_t *)ctx;
49     Again_Context_V2_t* pCtx = pGroupCtx->again_contex_v2;
50 
51     attr->eMode = pCtx->eMode;
52     memcpy(&attr->stAuto, &pCtx->stAuto, sizeof(attr->stAuto));
53     memcpy(&attr->stManual, &pCtx->stManual, sizeof(attr->stManual));
54 
55     return XCAM_RETURN_NO_ERROR;
56 }
57 
58 XCamReturn
rk_aiq_uapi_camgroup_againV2_GetInfo(const RkAiqAlgoContext * ctx,rk_aiq_gain_info_v2_t * pInfo)59 rk_aiq_uapi_camgroup_againV2_GetInfo(const RkAiqAlgoContext *ctx,
60                                      rk_aiq_gain_info_v2_t *pInfo)
61 {
62     CamGroup_AgainV2_Contex_t *pGroupCtx = (CamGroup_AgainV2_Contex_t *)ctx;
63     Again_Context_V2_t* pCtx = pGroupCtx->again_contex_v2;
64 
65 
66     pInfo->iso = pCtx->stExpInfo.arIso[pCtx->stExpInfo.hdr_mode];
67     pInfo->expo_info = pCtx->stExpInfo;
68 
69     return XCAM_RETURN_NO_ERROR;
70 }
71 
72 
73 #endif
74 
75