1 /* 2 * Copyright (c) 2019 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_CALIB_API_H_ 19 #define _RK_AIQ_CALIB_API_H_ 20 #include <string.h> 21 #include <stdio.h> 22 #include <stdlib.h> 23 //#include "tinyxml2.h" 24 25 #include "RkAiqCalibDbTypes.h" 26 27 #if defined(_MSC_VER) 28 #define strcasecmp _stricmp 29 #define snprintf(buf,len, format,...) _snprintf_s(buf, len, len-1, format, __VA_ARGS__) 30 #endif 31 #ifndef container_of 32 #define container_of(ptr, type, member) \ 33 ((type *)(((unsigned long)(unsigned char *)(ptr)) - (unsigned long)(&((type *)0)->member))) 34 35 #endif 36 #if defined(__linux__) 37 #include "smartptr.h" 38 #include <xcam_common.h> 39 #include "xcam_log.h" 40 41 #ifdef DCT_ASSERT 42 #undef DCT_ASSERT 43 #endif 44 #define DCT_ASSERT assert 45 46 #elif defined(_WIN32) 47 48 #ifdef DCT_ASSERT 49 #undef DCT_ASSERT 50 #endif 51 #define DCT_ASSERT(x) if(!(x))return false 52 53 #define LOGI printf 54 #define LOGD printf 55 #define LOGE printf 56 #define LOG1 printf 57 58 #endif 59 bool AddAecCalibProfile2AecCalibList(struct list_head *profile_list, CalibDb_Aec_CalibPara_t* pAddAec); 60 bool GetAecProfileFromAecCalibListBySceneName(const struct list_head* profile_list, const char* name, CalibDb_Aec_CalibPara_t** pAecProfile, int *name_index = NULL); 61 bool GetAecProfileFromAecCalibListByIdx(const struct list_head* profile_list, int idx, const CalibDb_Aec_CalibPara_t** pAecProfile) ; 62 bool AddAecTuneProfile2AecTuneList(struct list_head *profile_list, CalibDb_Aec_TunePara_t* pAddAec); 63 bool GetAecProfileFromAecTuneListBySceneName(const struct list_head* profile_list, const char* name, CalibDb_Aec_TunePara_t** pAecProfile); 64 bool GetAecProfileFromAecTuneListByIdx(const struct list_head* profile_list, int idx, const CalibDb_Aec_TunePara_t** pAecProfile) ; 65 bool AddAwbCalibV200Profile2AwbCalibV200List(struct list_head *profile_list, CalibDb_Awb_Calib_Para_V200_t* pAddAwb); 66 bool GetAwbProfileFromAwbCalibV200ListBySceneName(const struct list_head* profile_list, const char* name, CalibDb_Awb_Calib_Para_V200_t** pAwbProfile, int *name_index = NULL); 67 bool GetAwbProfileFromAwbCalibV200ListByIdx(const struct list_head* profile_list, int idx, const CalibDb_Awb_Calib_Para_V200_t** pAwbProfile) ; 68 bool AddAwbCalibV201Profile2AwbCalibV201List(struct list_head *profile_list, CalibDb_Awb_Calib_Para_V201_t* pAddAwb); 69 bool GetAwbProfileFromAwbCalibV201ListBySceneName(const struct list_head* profile_list, const char* name, CalibDb_Awb_Calib_Para_V201_t** pAwbProfile, int *name_index = NULL); 70 bool GetAwbProfileFromAwbCalibV201ListByIdx(const struct list_head* profile_list, int idx, const CalibDb_Awb_Calib_Para_V201_t** pAwbProfile) ; 71 bool AddAwbAdjustProfile2AwbAdjustList(struct list_head *profile_list, CalibDb_Awb_Adjust_Para_t* pAddAwb); 72 bool GetAwbProfileFromAwbAdjustListBySceneName(const struct list_head* profile_list, const char* name, CalibDb_Awb_Adjust_Para_t** pAwbProfile); 73 bool GetAwbProfileFromAwbAdjustListByIdx(const struct list_head* profile_list, int idx, const CalibDb_Awb_Adjust_Para_t** pAwbProfile) ; 74 75 bool CamCalibDbCreate 76 ( 77 CamCalibDbContext_t* pCamCalibDbCtx 78 ); 79 80 bool CamCalibDbRelease 81 ( 82 CamCalibDbContext_t* pCamCalibDbCtx 83 ) ; 84 85 bool CamCalibdbAddBayernrV2Setting2DProfile 86 ( 87 struct list_head *profile_list, 88 Calibdb_Bayernr_2Dparams_V2_t* pAdd 89 90 ); 91 92 bool CamCalibdbGetBayernrV2Setting2DByName 93 ( 94 const struct list_head* profile_list, 95 char* name, 96 Calibdb_Bayernr_2Dparams_V2_t** ppProfile 97 ); 98 99 bool CamCalibdbGetBayernrV2Setting2DByIdx 100 ( 101 const struct list_head* profile_list, 102 int idx, 103 Calibdb_Bayernr_2Dparams_V2_t** ppProfile 104 ); 105 106 bool CamCalibdbAddBayernrV2Setting3DProfile 107 ( 108 struct list_head *profile_list, 109 CalibDb_Bayernr_3DParams_V2_t* pAdd 110 ); 111 112 bool CamCalibdbGetBayernrV2Setting3DByName 113 ( 114 const struct list_head* profile_list, 115 char* name, 116 CalibDb_Bayernr_3DParams_V2_t** ppProfile 117 ); 118 119 bool CamCalibdbGetBayernrV2Setting3DByIdx 120 ( 121 const struct list_head* profile_list, 122 int idx, 123 CalibDb_Bayernr_3DParams_V2_t** ppProfile 124 ); 125 126 bool CamCalibdbAddBayernrV2Profile 127 ( 128 struct list_head *profile_list, 129 CalibDb_Bayernr_V2_t* pAdd 130 ) ; 131 132 bool CamCalibdbGetBayernrV2ProfileByName 133 ( 134 const struct list_head* profile_list, 135 char* name, 136 CalibDb_Bayernr_V2_t** ppProfile 137 ); 138 139 bool CamCalibdbGetBayernrV2ProfileByIdx 140 ( 141 const struct list_head* profile_list, 142 int idx, 143 CalibDb_Bayernr_V2_t** ppProfile 144 ); 145 146 bool CamCalibdbAddYnrV2SettingProfile 147 ( 148 struct list_head *profile_list, 149 Calibdb_Ynr_params_V2_t* pAdd 150 ); 151 152 bool CamCalibdbGetYnrV2SettingByName 153 ( 154 const struct list_head* profile_list, 155 char* name, 156 Calibdb_Ynr_params_V2_t** ppProfile 157 ); 158 159 bool CamCalibdbGetYnrV2SettingByIdx 160 ( 161 const struct list_head* profile_list, 162 int idx, 163 Calibdb_Ynr_params_V2_t** ppProfile 164 ); 165 166 bool CamCalibdbAddYnrV2Profile 167 ( 168 struct list_head *profile_list, 169 Calibdb_Ynr_V2_t* pAdd 170 ); 171 172 bool CamCalibdbGetYnrV2ProfileByName 173 ( 174 const struct list_head* profile_list, 175 char* name, 176 Calibdb_Ynr_V2_t** ppProfile 177 ); 178 179 bool CamCalibdbGetYnrV2ProfileByIdx 180 ( 181 const struct list_head* profile_list, 182 int idx, 183 Calibdb_Ynr_V2_t** ppProfile 184 ); 185 186 bool CamCalibdbAddCnrV1SettingProfile 187 ( 188 struct list_head *profile_list, 189 Calibdb_Cnr_params_V1_t* pAdd 190 191 ); 192 193 bool CamCalibdbGetCnrV1SettingByName 194 ( 195 const struct list_head* profile_list, 196 char* name, 197 Calibdb_Cnr_params_V1_t** ppProfile 198 ); 199 200 bool CamCalibdbGetCnrV1SettingByIdx 201 ( 202 const struct list_head* profile_list, 203 int idx, 204 Calibdb_Cnr_params_V1_t** ppProfile 205 ) ; 206 207 208 bool CamCalibdbAddCnrV1Profile 209 ( 210 struct list_head *profile_list, 211 Calibdb_Cnr_V1_t* pAdd 212 ); 213 214 bool CamCalibdbGetCnrV1ProfileByName 215 ( 216 const struct list_head* profile_list, 217 char* name, 218 Calibdb_Cnr_V1_t** ppProfile 219 ); 220 221 bool CamCalibdbGetCnrV1ProfileByIdx 222 ( 223 const struct list_head* profile_list, 224 int idx, 225 Calibdb_Cnr_V1_t** ppProfile 226 ); 227 228 229 bool CamCalibdbAddSharpV3SettingProfile 230 ( 231 struct list_head *profile_list, 232 Calibdb_Sharp_params_V3_t* pAdd 233 234 ); 235 236 bool CamCalibdbGetSharpV3SettingByName 237 ( 238 const struct list_head* profile_list, 239 char* name, 240 Calibdb_Sharp_params_V3_t** ppProfile 241 ); 242 243 bool CamCalibdbGetSharpV3SettingByIdx 244 ( 245 const struct list_head* profile_list, 246 int idx, 247 Calibdb_Sharp_params_V3_t** ppProfile 248 ); 249 250 bool CamCalibdbAddSharpV3Profile 251 ( 252 struct list_head *profile_list, 253 Calibdb_Sharp_V3_t* pAdd 254 ); 255 256 257 bool CamCalibdbGetSharpV3ProfileByName 258 ( 259 const struct list_head* profile_list, 260 char* name, 261 Calibdb_Sharp_V3_t** ppProfile 262 ); 263 264 bool CamCalibdbGetSharpV3ProfileByIdx 265 ( 266 const struct list_head* profile_list, 267 int idx, 268 Calibdb_Sharp_V3_t** ppProfile 269 ); 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 #endif 287