xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/algos/acgc/rk_aiq_uapi_acgc_int.cpp (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  *rk_aiq_uapi_acgc_int.cpp
3  *
4  *  Copyright (c) 2022 Rockchip Corporation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19 #include "rk_aiq_uapi_acgc_int.h"
20 
21 #include "rk_aiq_types_algo_acgc_prvt.h"
22 
23 XCamReturn
rk_aiq_uapi_acgc_SetAttrib(RkAiqAlgoContext * ctx,const rk_aiq_uapi_acgc_attrib_t * attr,bool need_sync)24 rk_aiq_uapi_acgc_SetAttrib(RkAiqAlgoContext* ctx,
25                            const rk_aiq_uapi_acgc_attrib_t* attr,
26                            bool need_sync)
27 {
28     if (ctx == NULL) {
29         LOGE_ACGC("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
30         return XCAM_RETURN_ERROR_PARAM;
31     }
32 
33     AcgcContext_t* pAcgcCtx = &ctx->acgcCtx;
34     pAcgcCtx->params        = attr->param;
35     pAcgcCtx->isReCal_ = true;
36 
37     return XCAM_RETURN_NO_ERROR;
38 }
39 
40 XCamReturn
rk_aiq_uapi_acgc_GetAttrib(const RkAiqAlgoContext * ctx,rk_aiq_uapi_acgc_attrib_t * attr)41 rk_aiq_uapi_acgc_GetAttrib(const RkAiqAlgoContext* ctx,
42                            rk_aiq_uapi_acgc_attrib_t* attr)
43 {
44     if (ctx == NULL || attr == NULL) {
45         LOGE_ACGC("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
46         return XCAM_RETURN_ERROR_PARAM;
47     }
48 
49     AcgcContext_t* pAcgcCtx = (AcgcContext_t*)&ctx->acgcCtx;
50     attr->param             = pAcgcCtx->params;
51     return XCAM_RETURN_NO_ERROR;
52 }
53