auto import from //depot/cupcake/@135843
[android/platform/external/neven.git] / Embedded / common / src / b_APIEm / FaceFinderRef.h
1 /*
2  * Copyright (C) 2008 The Android Open Source Project
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 #ifndef bpi_FACE_FINDER_REF_EM_H
18 #define bpi_FACE_FINDER_REF_EM_H
19
20 /* ---- includes ----------------------------------------------------------- */
21
22 #include "b_BasicEm/UInt16Arr.h"
23 #include "b_APIEm/FaceFinder.h"
24
25 /* ---- related objects  --------------------------------------------------- */
26
27 /* ---- typedefs ----------------------------------------------------------- */
28
29 /* ---- constants ---------------------------------------------------------- */
30
31 /* ---- object definition -------------------------------------------------- */
32
33 /** type independent reference to a faceFinder module */
34 struct bpi_FaceFinderRef 
35 {
36         /* ---- private data --------------------------------------------------- */
37
38         /* ---- public data ---------------------------------------------------- */
39
40         /** object buffer */
41         struct bbs_UInt16Arr objBufE;
42
43         /** faceFinder pointer */
44         struct bpi_FaceFinder* faceFinderPtrE;
45
46         /* ---- functions ------------------------------------------------------ */
47
48 };
49
50 /* ---- associated objects ------------------------------------------------- */
51
52 /* ---- external functions ------------------------------------------------- */
53
54 /* ---- \ghd{ constructor/destructor } ------------------------------------- */
55
56 /** initializes bpi_FaceFinderRef  */
57 void bpi_FaceFinderRef_init( struct bbs_Context* cpA,
58                                                          struct bpi_FaceFinderRef* ptrA );
59
60 /** resets bpi_FaceFinderRef  */
61 void bpi_FaceFinderRef_exit( struct bbs_Context* cpA,
62                                                          struct bpi_FaceFinderRef* ptrA );
63
64 /* ---- \ghd{ operators } -------------------------------------------------- */
65
66 /** copy operator */
67 void bpi_FaceFinderRef_copy( struct bbs_Context* cpA,
68                                                          struct bpi_FaceFinderRef* ptrA, 
69                                                          const struct bpi_FaceFinderRef* srcPtrA );
70
71 /** equal operator */
72 flag bpi_FaceFinderRef_equal( struct bbs_Context* cpA,
73                                                           const struct bpi_FaceFinderRef* ptrA, 
74                                                           const struct bpi_FaceFinderRef* srcPtrA );
75
76 /* ---- \ghd{ query functions } -------------------------------------------- */
77
78 /* ---- \ghd{ modify functions } ------------------------------------------- */
79
80 /* ---- \ghd{ memory I/O } ------------------------------------------------- */
81
82 /** word size (16-bit) object needs when written to memory */
83 uint32 bpi_FaceFinderRef_memSize( struct bbs_Context* cpA,
84                                                           const struct bpi_FaceFinderRef* ptrA );
85
86 /** writes object to memory; returns number of words (16-bit) written */
87 uint32 bpi_FaceFinderRef_memWrite( struct bbs_Context* cpA,
88                                                                const struct bpi_FaceFinderRef* ptrA, uint16* memPtrA );
89
90 /** reads object from memory; returns number of words (16-bit) read */
91 uint32 bpi_FaceFinderRef_memRead( struct bbs_Context* cpA,
92                                                               struct bpi_FaceFinderRef* ptrA, 
93                                                                   uint32 maxImageWidthA,
94                                                                   uint32 maxImageHeightA,
95                                                                   const uint16* memPtrA,
96                                                                   struct bbs_MemTbl* mtpA );
97
98 /* ---- \ghd{ exec functions } --------------------------------------------- */
99
100 /** sets detection range */ 
101 void bpi_FaceFinderRef_setRange( struct bbs_Context* cpA,
102                                                                  struct bpi_FaceFinderRef* ptrA, 
103                                                                  uint32 minEyeDistanceA,
104                                                                  uint32 maxEyeDistanceA );
105
106 /** single face processing function; returns confidence (8.24) */ 
107 int32 bpi_FaceFinderRef_process( struct bbs_Context* cpA,
108                                                              const struct bpi_FaceFinderRef* ptrA, 
109                                                                  struct bpi_DCR* dcrPtrA );
110
111 /** multiple face processing function; returns number of faces detected */ 
112 int32 bpi_FaceFinderRef_putDcr( struct bbs_Context* cpA,
113                                                                 const struct bpi_FaceFinderRef* ptrA, 
114                                                                 struct bpi_DCR* dcrPtrA );
115
116 /** retrieves indexed face from face finder after calling PutDCR */ 
117 void bpi_FaceFinderRef_getDcr( struct bbs_Context* cpA,
118                                                            const struct bpi_FaceFinderRef* ptrA, 
119                                                            uint32 indexA,
120                                                            struct bpi_DCR* dcrPtrA );
121
122 #endif /* bpi_FACE_FINDER_REF_EM_H */
123