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 btk_DCR_EM_H 18 #define btk_DCR_EM_H 19 20 #ifdef __cplusplus 21 extern "C" { 22 #endif 23 24 /** 25 * Data Carrier object 26 */ 27 28 /* ---- includes ----------------------------------------------------------- */ 29 30 #include "SDK.h" 31 32 /* ---- related objects --------------------------------------------------- */ 33 34 /** data carrier object */ 35 struct btk_DCR; 36 37 /* ---- typedefs ----------------------------------------------------------- */ 38 39 /** handle for data carrier object */ 40 typedef struct btk_DCR* btk_HDCR; 41 42 /** node data structure */ 43 typedef struct 44 { 45 s16p16 x; /* x-coordinate */ 46 s16p16 y; /* y-coordinate */ 47 s32 id; /* node id */ 48 s16p16 reserved; /* reserved for future versions (0) */ 49 } btk_Node; 50 51 /** rectangle data structure */ 52 typedef struct 53 { 54 s16p16 xMin; /* x min coordinate */ 55 s16p16 yMin; /* y min coordinate */ 56 s16p16 xMax; /* x max coordinate */ 57 s16p16 yMax; /* y max coordinate */ 58 } btk_Rect; 59 60 /** DCR creation parameters */ 61 typedef struct 62 { 63 /* reserved parameter (0) */ 64 u32 reserved; 65 66 } btk_DCRCreateParam; 67 68 /* ---- constants ---------------------------------------------------------- */ 69 70 /* ---- functions ---------------------------------------------------------- */ 71 72 /** returns default data carrier parameters */ 73 btk_DECLSPEC 74 btk_DCRCreateParam btk_DCR_defaultParam( void ); 75 76 /** creates a data carrier object */ 77 btk_DECLSPEC 78 btk_Status btk_DCR_create( btk_HSDK hsdkA, 79 const btk_DCRCreateParam* pCreateParamA, 80 btk_HDCR* hpdcrA ); 81 82 /** closes a data carrier object */ 83 btk_DECLSPEC 84 btk_Status btk_DCR_close( btk_HDCR hdcrA ); 85 86 /** deprecated (use assignImage) */ 87 btk_DECLSPEC 88 btk_Status btk_DCR_assignGrayByteImage( btk_HDCR hdcrA, 89 const void* pDataA, 90 u32 widthA, 91 u32 heightA ); 92 93 /** assigns a byte gray image referenced by pDataA to the data carrier */ 94 btk_DECLSPEC 95 btk_Status btk_DCR_assignImage( btk_HDCR hdcrA, 96 const void* pDataA, 97 u32 widthA, 98 u32 heightA ); 99 100 /** deprecated (use assignImageROI) */ 101 btk_DECLSPEC 102 btk_Status btk_DCR_assignGrayByteImageROI( btk_HDCR hdcrA, 103 const void* pDataA, 104 u32 widthA, 105 u32 heightA, 106 const btk_Rect* pRectA ); 107 108 /** assigns a byte gray image referenced by pDataA to the data carrier and 109 * a region of interest given by pRectA. 110 */ 111 btk_DECLSPEC 112 btk_Status btk_DCR_assignImageROI( btk_HDCR hdcrA, 113 const void* pDataA, 114 u32 widthA, 115 u32 heightA, 116 const btk_Rect* pRectA ); 117 118 /** extracts facial rectangle */ 119 btk_DECLSPEC 120 btk_Status btk_DCR_getRect( btk_HDCR hdcrA, 121 btk_Rect* pRectA ); 122 123 /** returns number of available landmark nodes */ 124 btk_DECLSPEC 125 u32 btk_DCR_nodeCount( btk_HDCR hdcrA ); 126 127 /** extracts information about indexed node */ 128 btk_DECLSPEC 129 btk_Status btk_DCR_getNode( btk_HDCR hdcrA, 130 u32 indexA, 131 btk_Node* pNodeA ); 132 133 /** returns confidence 8.24 fixed format */ 134 btk_DECLSPEC 135 s8p24 btk_DCR_confidence( btk_HDCR hdcrA ); 136 137 /** returns approval flag (0=false; 1=true)*/ 138 btk_DECLSPEC 139 u32 btk_DCR_approved( btk_HDCR hdcrA ); 140 141 142 #ifdef __cplusplus 143 } 144 #endif 145 146 #endif /* btk_DCR_EM_H */ 147