1 /*
2 *rk_aiq_uapi_acsm_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_acsm_int.h"
20 #include "rk_aiq_types_algo_acsm_prvt.h"
21
22 XCamReturn
rk_aiq_uapi_acsm_SetAttrib(RkAiqAlgoContext * ctx,const rk_aiq_uapi_acsm_attrib_t * attr,bool need_sync)23 rk_aiq_uapi_acsm_SetAttrib(RkAiqAlgoContext* ctx,
24 const rk_aiq_uapi_acsm_attrib_t* attr,
25 bool need_sync)
26 {
27 if(ctx == NULL) {
28 LOGE_ACSM("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
29 return XCAM_RETURN_ERROR_PARAM;
30 }
31
32 AcsmContext_t* pAcsmCtx = &ctx->acsmCtx;
33 pAcsmCtx->params = attr->param;
34 pAcsmCtx->isReCal_ = true;
35 return XCAM_RETURN_NO_ERROR;
36 }
37
38 XCamReturn
rk_aiq_uapi_acsm_GetAttrib(RkAiqAlgoContext * ctx,rk_aiq_uapi_acsm_attrib_t * attr)39 rk_aiq_uapi_acsm_GetAttrib
40 (
41 RkAiqAlgoContext* ctx,
42 rk_aiq_uapi_acsm_attrib_t* attr
43 )
44 {
45 if(ctx == NULL || attr == NULL) {
46 LOGE_ACSM("%s(%d): null pointer\n", __FUNCTION__, __LINE__);
47 return XCAM_RETURN_ERROR_PARAM;
48 }
49
50 AcsmContext_t* pAcsmCtx = &ctx->acsmCtx;
51 attr->param = pAcsmCtx->params;
52 return XCAM_RETURN_NO_ERROR;
53 }
54
55