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 #include "uAPI2/rk_aiq_user_api2_adegamma.h"
17
18 #include "algo_handlers/RkAiqAdegammaHandle.h"
19
20 RKAIQ_BEGIN_DECLARE
21
22
23 #ifdef RK_SIMULATOR_HW
24 #define CHECK_USER_API_ENABLE
25 #endif
26
27 #if RKAIQ_HAVE_DEGAMMA_V1
28 XCamReturn
rk_aiq_user_api2_adegamma_SetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,rk_aiq_degamma_attrib_t attr)29 rk_aiq_user_api2_adegamma_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, rk_aiq_degamma_attrib_t attr)
30 {
31 CHECK_USER_API_ENABLE2(sys_ctx);
32 CHECK_USER_API_ENABLE(RK_AIQ_ALGO_TYPE_ADEGAMMA);
33 RKAIQ_API_SMART_LOCK(sys_ctx);
34 RkAiqAdegammaHandleInt* algo_handle =
35 algoHandle<RkAiqAdegammaHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_ADEGAMMA);
36
37 if (algo_handle) {
38 return algo_handle->setAttrib(attr);
39 }
40
41 return XCAM_RETURN_NO_ERROR;
42 }
43
44 XCamReturn
rk_aiq_user_api2_adegamma_GetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,rk_aiq_degamma_attrib_t * attr)45 rk_aiq_user_api2_adegamma_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, rk_aiq_degamma_attrib_t *attr)
46 {
47 RKAIQ_API_SMART_LOCK(sys_ctx);
48 RkAiqAdegammaHandleInt* algo_handle =
49 algoHandle<RkAiqAdegammaHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_ADEGAMMA);
50
51 if (algo_handle) {
52 return algo_handle->getAttrib(attr);
53 }
54
55 return XCAM_RETURN_NO_ERROR;
56 }
57 #else
58 XCamReturn
59 rk_aiq_user_api2_adegamma_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, rk_aiq_degamma_attrib_t attr) {
60 return XCAM_RETURN_ERROR_UNKNOWN;
61 }
62
63 XCamReturn
64 rk_aiq_user_api2_adegamma_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, rk_aiq_degamma_attrib_t *attr) {
65 return XCAM_RETURN_ERROR_UNKNOWN;
66 }
67 #endif
68
69
70 RKAIQ_END_DECLARE
71