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_USER_API_AHDR_H_ 19 #define _RK_AIQ_USER_API_AHDR_H_ 20 21 #include "RkAiqCalibDbTypes.h" 22 #include "uAPI2/rk_aiq_user_api2_atmo.h" 23 #include "uAPI2/rk_aiq_user_api2_amerge.h" 24 25 26 /* 27 typedef enum hdr_OpMode_s { 28 HDR_OpMode_Api_OFF = 0, // run IQ ahdr 29 HDR_OpMode_Auto = 1, //run api auto ahdr 30 HDR_OpMode_MANU = 2, //run api manual ahdr 31 HDR_OpMode_SET_LEVEL = 3, // its prevously fast mode, run api set level 32 HDR_OpMode_DarkArea = 4, // for dark area luma inprove, no matter the scene is night, normal, or hdr 33 HDR_OpMode_Tool = 5, // for dark area luma inprove, no matter the scene is night, normal, or hdr 34 } hdr_OpMode_t; 35 36 typedef struct ahdrAttr_s 37 { 38 bool bUpdateTmo; 39 bool bUpdateMge; 40 amgeAttr_t stMgeAuto; 41 atmoAttr_t stTmoAuto; 42 } ahdrAttr_t; 43 44 typedef struct mhdrAttr_s 45 { 46 bool bUpdateTmo; 47 bool bUpdateMge; 48 mmgeAttr_t stMgeManual; 49 mtmoAttr_t stTmoManual; 50 } mhdrAttr_t; 51 52 typedef struct CurrCtlData_s 53 { 54 int SceneMode; 55 float GlobalLumaMode; 56 float DetailsHighLightMode; 57 float DetailsLowLightMode; 58 float GlobalTmoMode; 59 float LocalTMOMode; 60 float Envlv; 61 float MoveCoef; 62 float ISO; 63 float OEPdf; 64 float FocusLuma; 65 float DarkPdf; 66 float DynamicRange; 67 } CurrCtlData_t; 68 69 typedef struct CurrRegData_s 70 { 71 float OECurve_smooth; 72 float OECurve_offset; 73 float MDCurveLM_smooth; 74 float MDCurveLM_offset; 75 float MDCurveMS_smooth; 76 float MDCurveMS_offset; 77 78 float GlobalLuma; 79 float DetailsLowlight; 80 float DetailsHighlight; 81 float LocalTmoStrength; 82 float GlobaltmoStrength; 83 } CurrRegData_t; 84 85 typedef struct CalibDb_HdrMerge_s 86 { 87 float envLevel[13]; 88 float oeCurve_smooth[13]; 89 float oeCurve_offset[13]; 90 float moveCoef[13]; 91 float mdCurveLm_smooth[13]; 92 float mdCurveLm_offset[13]; 93 float mdCurveMs_smooth[13]; 94 float mdCurveMs_offset[13]; 95 float oeCurve_damp; 96 float mdCurveLm_damp; 97 float mdCurveMs_damp; 98 } CalibDb_HdrMerge_t; 99 100 typedef struct CalibDb_HdrTmo_s 101 { 102 TMO_en_t en[CALIBDB_MAX_MODE_NUM]; 103 GlobalLuma_t luma[CALIBDB_MAX_MODE_NUM]; 104 DetailsHighLight_t HighLight[CALIBDB_MAX_MODE_NUM]; 105 DetailsLowLight_t LowLight[CALIBDB_MAX_MODE_NUM]; 106 LocalTMO_t LocalTMO[CALIBDB_MAX_MODE_NUM]; 107 GlobaTMO_t GlobaTMO[CALIBDB_MAX_MODE_NUM]; 108 float damp; 109 } CalibDb_HdrTmo_t; 110 111 typedef struct CalibDb_Ahdr_Para_s { 112 CalibDb_HdrMerge_t merge; 113 CalibDb_HdrTmo_t tmo; 114 } CalibDb_Ahdr_Para_t; 115 116 typedef struct ahdr_attrib_s 117 { 118 hdr_OpMode_t opMode; 119 ahdrAttr_t stAuto; 120 mhdrAttr_t stManual; 121 FastMode_t stSetLevel; 122 DarkArea_t stDarkArea; 123 CurrCtlData_t CtlInfo; 124 CurrRegData_t RegInfo; 125 CalibDb_Ahdr_Para_t stTool; 126 } ahdr_attrib_t; 127 128 typedef struct rk_aiq_sys_ctx_s rk_aiq_sys_ctx_t; 129 */ 130 131 RKAIQ_BEGIN_DECLARE 132 133 /* 134 XCamReturn 135 rk_aiq_user_api_ahdr_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, ahdr_attrib_t attr); 136 XCamReturn 137 rk_aiq_user_api_ahdr_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, ahdr_attrib_t* attr); 138 */ 139 140 RKAIQ_END_DECLARE 141 142 #endif 143