1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
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 HOS_CAMERA_IPP_ALGO_H
17 #define HOS_CAMERA_IPP_ALGO_H
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 enum IppAlgoMode {
24     IPP_ALGO_MODE_BEGIN,
25     IPP_ALGO_MODE_NORMAL = IPP_ALGO_MODE_BEGIN,
26     IPP_ALGO_MODE_BEAUTY,
27     IPP_ALGO_MODE_HDR,
28     IPP_ALGO_MODE_END
29 };
30 
31 typedef struct IppAlgoMeta {
32     int mode;
33     int faceRect[4][2];
34     char reserved[64];
35 } IppAlgoMeta;
36 
37 typedef struct IppAlgoBuffer {
38     void* addr;
39     unsigned int width;
40     unsigned int height;
41     unsigned int stride;
42     unsigned int size;
43     int id;
44 } IppAlgoBuffer;
45 
46 typedef struct IppAlgoFunc {
47     int (*Init)(IppAlgoMeta* meta);
48     int (*Start)(void);
49     int (*Flush)(void);
50     int (*Process)(IppAlgoBuffer* inBuffer[], int inBufferCount, IppAlgoBuffer* outBuffer, IppAlgoMeta* meta);
51     int (*Stop)(void);
52 } IppAlgoFunc;
53 
54 typedef int (*AlgoFuncInit)(IppAlgoMeta *);
55 typedef int (*AlgoFuncStart)(void);
56 typedef int (*AlgoFuncFlush)(void);
57 typedef int (*AlgoFuncProcess)(IppAlgoBuffer* inBuffer[],
58     int inBufferCount, IppAlgoBuffer* outBuffer, IppAlgoMeta* meta);
59 typedef int (*AlgoFuncStop)(void);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif
66