• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 HiSilicon (Shanghai) Technologies CO., LIMITED.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef HI_COMM_SNAP_H
17 #define HI_COMM_SNAP_H
18 
19 #include "hi_common.h"
20 #include "hi_comm_video.h"
21 #include "hi_comm_isp.h"
22 
23 #ifdef __cplusplus
24 #if __cplusplus
25 extern "C" {
26 #endif
27 #endif /* __cplusplus */
28 
29 typedef enum hiSNAP_TYPE_E {
30     SNAP_TYPE_NORMAL, /* ZSL and none-ZSL type */
31     SNAP_TYPE_PRO, /* Professional type support HDR, AEB, LongExposure */
32     SNAP_TYPE_BUTT
33 } SNAP_TYPE_E;
34 
35 typedef struct hiSNAP_PRO_MANUAL_PARAM_S {
36     HI_U32 au32ManExpTime[PRO_MAX_FRAME_NUM]; /* RW;  Range: [0x0, 0xFFFFFFFF];sensor exposure time (unit: us),
37                                                                     it's related to the specific sensor */
38     HI_U32 au32ManSysgain[PRO_MAX_FRAME_NUM]; /* RW;  Range: [0x400, 0xFFFFFFFF];system gain (unit: times,
39                                                                     10bit precision), it's related to the specific
40                                                                     sensor and ISP Dgain range */
41 } SNAP_PRO_MANUAL_PARAM_S;
42 
43 typedef struct hiSNAP_PRO_AUTO_PARAM_S {
44     HI_U16 au16ProExpStep[PRO_MAX_FRAME_NUM]; /* RW; Range:[0x0, 0xFFFF];Professional exposure step
45                                                                     (unit: times, 8bit precision) */
46 } SNAP_PRO_AUTO_PARAM_S;
47 
48 typedef struct hiSNAP_PRO_PARAM_S {
49     OPERATION_MODE_E enOperationMode;
50     SNAP_PRO_AUTO_PARAM_S stAutoParam;
51     SNAP_PRO_MANUAL_PARAM_S stManualParam;
52 } SNAP_PRO_PARAM_S;
53 
54 typedef struct hiSNAP_NORMAL_ATTR_S {
55     HI_U32  u32FrameCnt;         /* RW;Set capture frame counts */
56     HI_U32  u32RepeatSendTimes;  /* [0, 3]; When FE-BE is offline, the first raw frame that is triggered should be sent
57                                                     repeatedly to the BE. */
58 
59     /* ZSL struct */
60     HI_BOOL bZSL;           /* RW;statical attrs */
61     HI_U32  u32FrameDepth;  /* buffer depth: [1,8] */
62     HI_U32  u32RollbackMs;  /* RW;Rollback time, unit(ms), invalid when bZSL is HI_FALSE  */
63     HI_U32  u32Interval;    /* RW;For continuous capture, select frame every u32Intercal frames */
64 } SNAP_NORMAL_ATTR_S;
65 
66 typedef struct hiSNAP_PRO_ATTR_S {
67     HI_U32  u32FrameCnt;          /* [1, PRO_MAX_FRAME_NUM] */
68     HI_U32  u32RepeatSendTimes;   /* [0, 3];When FE-BE is offline, the first raw frame that is triggered should be sent
69                                                     repeatedly to the BE. */
70     SNAP_PRO_PARAM_S stProParam;
71 } SNAP_PRO_ATTR_S;
72 
73 typedef struct hiSNAP_USER_ATTR_S {
74     HI_U32 u32FrameDepth;
75 } SNAP_USER_ATTR_S;
76 
77 typedef struct hiSNAP_ATTR_S {
78     SNAP_TYPE_E enSnapType;
79     HI_BOOL bLoadCCM;    /* HI_TRUE:use CCM of SnapIspInfo, HI_FALSE: Algorithm calculate */
80     union {
81         SNAP_NORMAL_ATTR_S     stNormalAttr;
82         SNAP_PRO_ATTR_S        stProAttr;
83     };
84 } SNAP_ATTR_S;
85 
86 typedef struct hiISP_PRO_BNR_PARAM_S {
87     HI_BOOL bEnable;
88     HI_U32 u32ParamNum;
89     ISP_NR_AUTO_ATTR_S *pastNrAttr;
90 } ISP_PRO_BNR_PARAM_S;
91 
92 typedef struct hiISP_PRO_SHARPEN_PARAM_S {
93     HI_BOOL bEnable;
94     HI_U32 u32ParamNum;
95     ISP_SHARPEN_AUTO_ATTR_S *pastShpAttr;
96 } ISP_PRO_SHARPEN_PARAM_S;
97 
98 #ifdef __cplusplus
99 #if __cplusplus
100 }
101 #endif
102 #endif /* __cplusplus */
103 
104 #endif /* HI_COMM_SNAP_H */
105