![]() |
00001 #ifndef FPSAPI_INCL 00002 #define FPSAPI_INCL 00003 /******************************************************************************* 00004 * FPS API 2009-2021 (c) Adaptive Recognition 00005 * 2021.06.03 v2.1.10 00006 ******************************************************************************/ 00007 #ifdef GX_DOTNET 00008 #using "gxdotnet7.dll" 00009 #endif 00010 #include "gxsd.h" 00011 #include "fpstypes.h" 00012 #include "gximage.h" 00013 00014 #if defined(WIN32) && !defined(GX_DOTNET) 00015 #include <windows.h> 00016 #endif 00017 /******************************************************************************/ 00018 #ifdef _MSC_VER 00019 #pragma warning(push) 00020 #pragma warning(disable : 4786) /* truncated debug info */ 00021 #endif 00022 #ifdef __BORLANDC__ 00023 #pragma warn -rch 00024 #endif 00025 /******************************************************************************/ 00026 #ifdef GX_NAMESPACES 00027 namespace fps { 00028 using namespace gx; 00029 #endif 00030 00112 #ifndef GX_MANUAL 00113 /* .NET Workarounds */ 00114 #ifdef GX_DOTNET 00115 #pragma unmanaged 00116 #define _GX_ENOENT 2 00117 #define _FPS_UMODE_DISCONNECT 0 00118 #define gxPG4 _gxPG4 00119 #ifdef WIN32 00120 #define HWND void* 00121 #define UINT unsigned int 00122 #endif 00123 #define GXVF GX_VARIANT_FLAGS:: 00124 #define GXEC GX_ERROR_CODES:: 00125 #else 00126 #define _GX_ENOENT GX_ENOENT 00127 #define _FPS_UMODE_DISCONNECT FPS_UMODE_DISCONNECT 00128 #define GXVF 00129 #define GXEC 00130 #endif 00131 #endif/* GX_MANUAL */ 00132 00133 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL) /*(*/ 00134 00135 /******************************************************************************* 00136 * call codes 00137 ******************************************************************************/ 00138 00139 /* Call codes for the Fingerprint Scanner routines. */ 00140 enum { 00141 FPS_CALL_GROUP_FPSAPI = 0x20080000, /* Caller ID of the fpsapi module */ 00142 FPSAPI_CALL_USEDEVICE = FPS_CALL_GROUP_FPSAPI+2, /* Call code of the fps_usedevice() function (Unicode version). */ 00143 FPSAPI_CALL_USEDEVICEA = FPS_CALL_GROUP_FPSAPI+3, /* Call code of the fps_usedevice() function (ASCII version). */ 00144 FPSAPI_CALL_CALIBRATE = FPS_CALL_GROUP_FPSAPI+60, /* Call code of the fps_calibrate() function */ 00145 FPSAPI_CALL_ISCALIBRATED = FPS_CALL_GROUP_FPSAPI+61, /* Call code of the fps_iscalibrated() function */ 00146 FPSAPI_CALL_SETEVENTFUNCTION = FPS_CALL_GROUP_FPSAPI+11, /* Call code of the fps_seteventfunction() function */ 00147 FPSAPI_CALL_TEST_PRESENCE = FPS_CALL_GROUP_FPSAPI+63, /* Call code of the fps_testpresence() function */ 00148 FPSAPI_CALL_CAPTURE_GETSTATUS = FPS_CALL_GROUP_FPSAPI+15, /* Call code of the fps_capture_getstatus() function */ 00149 FPSAPI_CALL_CAPTURE_WAIT = FPS_CALL_GROUP_FPSAPI+16, /* Call code of the fps_capture_wait() function */ 00150 FPSAPI_CALL_CAPTURE_PREVIEW = FPS_CALL_GROUP_FPSAPI+64, /* Call code of the fps_capture_preview() function */ 00151 FPSAPI_CALL_SAVEIMAGE = FPS_CALL_GROUP_FPSAPI+19, /* Call code of the fps_saveimage() function (Unicode version). */ 00152 FPSAPI_CALL_SAVEIMAGEA = FPS_CALL_GROUP_FPSAPI+20, /* Call code of the fps_saveimage() function (ASCII version). */ 00153 FPSAPI_CALL_DRAWIMAGE = FPS_CALL_GROUP_FPSAPI+21, /* Call code of the fps_drawimage() function */ 00154 FPSAPI_CALL_SET_STATUS_LED = FPS_CALL_GROUP_FPSAPI+68, /* Call code of the fps_setstatusled() function */ 00155 FPSAPI_CALL_TEST_POWER = FPS_CALL_GROUP_FPSAPI+69, /* Call code of the fps_testpower() function */ 00156 FPSAPI_CALL_TEST_BUTTON = FPS_CALL_GROUP_FPSAPI+70, /* Call code of the fps_testbutton() function */ 00157 FPSAPI_CALL_BEGIN_WINDOW_MESSAGING = FPS_CALL_GROUP_FPSAPI+82, /* Call code of the fps_beginwindowmessaging() function */ 00158 FPSAPI_CALL_END_WINDOW_MESSAGING = FPS_CALL_GROUP_FPSAPI+83, /* Call code of the fps_endwindowmessaging() function */ 00159 FPSAPI_CALL_GET_BUTTON_EVENT = FPS_CALL_GROUP_FPSAPI+84, /* Call code of the fps_getbuttonevent() function */ 00160 FPSAPI_CALL_SUSPEND = FPS_CALL_GROUP_FPSAPI+85, /* Call code of the fps_suspend() function */ 00161 FPSAPI_CALL_WAKEUP = FPS_CALL_GROUP_FPSAPI+86, /* Call code of the fps_wakeup() function */ 00162 FPSAPI_CALL_GET_UDINFO = FPS_CALL_GROUP_FPSAPI+94, /* Call code of the fps_getudinfo() function */ 00163 FPSAPI_CALL_READ_UD = FPS_CALL_GROUP_FPSAPI+95, /* Call code of the fps_readudata() function */ 00164 FPSAPI_CALL_WRITE_UD = FPS_CALL_GROUP_FPSAPI+96, /* Call code of the fps_writeudata() function */ 00165 FPSAPI_CALL_GETIMAGE_V = FPS_CALL_GROUP_FPSAPI+130, /* Call code of the fps_getimage() function */ 00166 FPSAPI_CALL_GETDEVICEINFO = FPS_CALL_GROUP_FPSAPI+131, /* Call code of the fps_getdeviceinfo() function */ 00167 FPSAPI_CALL_CAPTURE = FPS_CALL_GROUP_FPSAPI+136, /* Call code of the fps_capture() function */ 00168 FPSAPI_CALL_CAPTURE_START = FPS_CALL_GROUP_FPSAPI+137, /* Call code of the fps_capture_start() function */ 00169 FPSAPI_CALL_RESETFINGERLIST = FPS_CALL_GROUP_FPSAPI+138, /* Call code of the fps_resetfingerlist() function */ 00170 FPSAPI_CALL_FINGERSTONIST = FPS_CALL_GROUP_FPSAPI+139, /* Call code of the fps_fingertonist() function */ 00171 FPSAPI_CALL_FINGERSTONISTA = FPS_CALL_GROUP_FPSAPI+140, /* Call code of the fps_fingertonista() function */ 00172 FPSAPI_CALL_FINGERSTONISTMEM = FPS_CALL_GROUP_FPSAPI+141, /* Call code of the fps_fingertonistmem() function */ 00173 FPSAPI_CALL_GETDEVICELIST = FPS_CALL_GROUP_FPSAPI+147, /* Call code of the fps_getfingerdevicelist() function (Unicode version). */ 00174 FPSAPI_CALL_GETDEVICELISTA = FPS_CALL_GROUP_FPSAPI+148, /* Call code of the fps_getfingerdevicelist() function (ASCII version). */ 00175 FPSAPI_CALL_CAPTURE_STOP = FPS_CALL_GROUP_FPSAPI+149, /* Call code of the fps_capture_stop() function */ 00176 FPSAPI_CALL_NISTFINGERQUALITY = FPS_CALL_GROUP_FPSAPI+150, /* Call code of the fps_nistfingerquality() function */ 00177 FPSAPI_CALL_BLINK_STATUS = FPS_CALL_GROUP_FPSAPI+151, /* Call code of the fps_blinkstatus() function */ 00178 FPSAPI_CALL_FINGERMINUTIATOMEM = FPS_CALL_GROUP_FPSAPI+188, /* Call code of the pr_fingerminutiatomem() function */ 00179 FPSAPI_CALL_FINGERMINUTIATOFILE = FPS_CALL_GROUP_FPSAPI+189, /* Call code of the pr_fingerminutiatofile() function */ 00180 FPSAPI_CALL_FINGERMINUTIATOFILEA = FPS_CALL_GROUP_FPSAPI+190, /* Call code of the pr_fingerminutiatofilea() function */ 00181 }; 00182 00183 /******************************************************************************* 00184 * module structures 00185 ******************************************************************************/ 00186 00187 /* 00188 Parameter structure for the fps_..._getstatus asynchronous functions. 00189 */ 00190 struct FPSAPI_PARM_GETSTATUS { 00191 int reqid; /* Id returned by the fps_..._start asynchronous function. */ 00192 int status; /* The state of the process in percent, it can be negative when the task is in 00193 preprocess state. */ 00194 }; 00195 00196 /* 00197 Parameter structure for the fps_getdevicelist() function (Unicode version). 00198 */ 00199 struct FPSAPI_PARM_GETDEVICELIST { 00200 wchar_t **devices; /* List of the device names. */ 00201 bool *calibrated; /* Obsolete parameter. */ 00202 int ndevices; /* Number of devices */ 00203 }; 00204 00205 /* 00206 Parameter structure for the fps_getdevicelist() function (ASCII version). 00207 */ 00208 struct FPSAPI_PARM_GETDEVICELISTA { 00209 char **devices; /* List of the device names. */ 00210 bool *calibrated; /* Obsolete parameter. */ 00211 int ndevices; /* Number of the devices. */ 00212 }; 00213 00214 /* 00215 Parameter structure for the fps_usedevice() function (Unicode version). 00216 */ 00217 struct FPSAPI_PARM_USEDEVICE { 00218 const wchar_t *device; /* Name of the device to connect to. */ 00219 int mode; /* Connection mode. The possible values are defined in the FPS_USAGEMODE 00220 enumeration. Generally the FPS_UMODE_FULL_CONTROL is recommended to use. */ 00221 }; 00222 00223 /* 00224 Parameter structure for the fps_usedevice() function (ASCII version). 00225 */ 00226 struct FPSAPI_PARM_USEDEVICEA { 00227 const char *device; /* Name of the device to connect to. */ 00228 int mode; /* Connection mode. The possible values are defined in the FPS_USAGEMODE 00229 enumeration. Generally the FPS_UMODE_FULL_CONTROL is recommended to use. */ 00230 }; 00231 00232 /* 00233 Parameter structure for the fps_calibrate() function. 00234 */ 00235 struct FPSAPI_PARM_CALIBRATE { 00236 int windowid; /* Id of the used window. The possible values are defined in the FPS_WINDOW_ID 00237 enumeration. */ 00238 }; 00239 00240 /* 00241 Parameter structure for the fps_iscalibrated() function. 00242 */ 00243 struct FPSAPI_PARM_ISCALIBRATED { 00244 int windowid; /* Id of the used window. The possible values are defined in the FPS_WINDOW_ID 00245 enumeration. */ 00246 }; 00247 00248 #endif/* GX_SWIGIF GX_MANUAL )*/ 00249 #if !defined(GX_SWIGIF) && !(defined(GX_MANUAL) && defined(GX_DOTNET)) /*(*/ 00250 00264 typedef void GXAPI FPS_EVFUNC(int event,int param1,int param2,void* uparam); 00265 00268 #endif/* GX_SWIGIF GX_MANUAL GX_DOTNET )*/ 00269 #if !defined(GX_SWIGIF) && !defined(GX_MANUAL) /*(*/ 00270 00271 /* 00272 Parameter structure for the fps_seteventfunction() function. 00273 */ 00274 struct FPSAPI_PARM_SETEVENTFUNCTION { 00275 FPS_EVFUNC *func; /* Reference to the callback function. */ 00276 void *param; /* User parameter. */ 00277 }; 00278 00279 /* 00280 Parameter structure for the fps_testpresence() function. 00281 */ 00282 struct FPSAPI_PARM_TEST_PRESENCE { 00283 int state; /* The result of the presence test. */ 00284 int windowid; /* Id of the used window. The possible values are defined in the FPS_WINDOW_ID 00285 enumeration. */ 00286 }; 00287 00288 /* 00289 Parameter structure for the fps_capture_wait() function. 00290 */ 00291 struct FPSAPI_PARM_CAPTURE_WAIT { 00292 int reqid; /* Id returned by the fps_capture_start() function. */ 00293 }; 00294 00295 /* 00296 Parameter structure for the fps_capture_preview() function. 00297 */ 00298 struct FPSAPI_PARM_CAPTURE_PREVIEW { 00299 int windowid; /* Id of the used window. The possible values are defined in the FPS_WINDOW_ID enumeration. */ 00300 }; 00301 00302 /* 00303 Parameter structure for the fps_getimage() function. 00304 */ 00305 struct FPSAPI_PARM_GETIMAGE_V { 00306 int smode; /* The actual scan mode of the image. The possible values are defined in 00307 FPS_IMPRESSION_TYPE enumeration. */ 00308 int position; /* The finger position. The possible values are defined in the 00309 FPS_POSITION enumeration. */ 00310 int type; /* The type of the image. The possible values are defined in the FPS_IMAGE_TYPE 00311 enumeration. If the type is FPS_IT_PREVIEW the smode and position parameters have no meanings. */ 00312 gxVARIANT img; /* Reference for the image. */ 00313 }; 00314 00315 /* 00316 Parameter structure for the fps_saveimage() function (Unicode version). 00317 */ 00318 struct FPSAPI_PARM_SAVEIMAGE { 00319 int smode; /* The actual scan mode of the image. The possible values are defined in 00320 FPS_IMPRESSION_TYPE enumeration. */ 00321 int position; /* The finger position. The possible values are defined in the 00322 FPS_POSITION enumeration. */ 00323 int type; /* The type of the image. The possible values are defined in the FPS_IMAGE_TYPE 00324 enumeration. If the type is FPS_IT_PREVIEW the smode and position parameters have no meanings. */ 00325 const wchar_t *filename;/* The name of the file for saving the image. */ 00326 int filetype; /* The type of the file. The currently supported file types are defined in the file gximage.h . */ 00327 }; 00328 00329 /* 00330 Parameter structure for the fps_saveimage() function (ASCII version). 00331 */ 00332 struct FPSAPI_PARM_SAVEIMAGEA { 00333 int smode; /* The actual scan mode of the image. The possible values are defined in 00334 FPS_IMPRESSION_TYPE enumeration. */ 00335 int position; /* The finger position. The possible values are defined in the 00336 FPS_POSITION enumeration. */ 00337 int type; /* The type of the image. The possible values are defined in the FPS_IMAGE_TYPE 00338 enumeration. If the type is FPS_IT_PREVIEW the smode and position parameters have no meanings. */ 00339 const char *filename; /* The name of the file for saving the image. */ 00340 int filetype; /* The type of the file. The currently supported file types are defined in the file gximage.h . */ 00341 }; 00342 00343 #if defined(WIN32) && !defined(GX_DOTNET) 00344 00345 /* 00346 Parameter structure for the fps_drawimage() function. 00347 */ 00348 struct FPSAPI_PARM_DRAWIMAGE { 00349 int smode; /* The actual scan mode of the image. The possible values are defined in 00350 FPS_IMPRESSION_TYPE enumeration. */ 00351 int position; /* The finger position. The possible values are defined in the 00352 FPS_POSITION enumeration. */ 00353 int type; /* The type of the image. The possible values are defined in the FPS_IMAGE_TYPE 00354 enumeration. If the type is FPS_IT_PREVIEW the smode and position parameters have no meanings. */ 00355 HDC hdc; /* Handle to the device context. */ 00356 int x; /* Left side of the drawing area. */ 00357 int y; /* Upper side of the drawing area. */ 00358 int xsize; /* Horizontal size of the drawing area. */ 00359 int ysize; /* Vertical size of the drawing area. */ 00360 gxRCT *frame; /* Frame of the area of the image to display. */ 00361 }; 00362 00363 #endif/* WIN32 GX_DOTNET */ 00364 00365 /* 00366 Parameter structure for the fps_nistfingerquality() function. 00367 */ 00368 struct FPSAPI_PARM_NISTFINGERQUALITY { 00369 int position; /* The finger position. The possible values are defined in the FPS_POSITION enumeration. */ 00370 int quality; /* Finger NIST quality value */ 00371 }; 00372 00373 /* 00374 Parameter structure for the fps_setstatusled() function. 00375 */ 00376 struct FPSAPI_PARM_SET_STATUS_LED { 00377 int ledmask; /* Mask representing the status leds. Each bit represents a status led on the device. */ 00378 int color; /* The color to display on the specified status leds. The predefined values of the lights 00379 are stored in the FPS_STATUS_LED_COLOR enumeration. Bit 7 represents the on/off 00380 parameter of the light so any value below 80 hex means led off.*/ 00381 }; 00382 00383 /* 00384 Parameter structure for the fps_blinkstatus() function. 00385 */ 00386 struct FPSAPI_PARM_BLINK_STATUS { 00387 int coding; /* Coding of the data. The possible values are: 00388 0: stop pulses, 00389 1: data[odd]: time duration output high level [ms], data[even]: time duration output low level [ms] 00390 */ 00391 int iteration; /* Number of repeat, 0 menas forever. */ 00392 int mask; /* Mask representing the status leds and buzzer. Each bit represents a status led or buzzer on the device. */ 00393 int type; /* Led color id or buzzer id. Its predefined values are stored in the 00394 \ref FPS_STATUS_LED_COLOR and \ref FPS_BUZZER enumerations. */ 00395 unsigned int datalength;/* Length of the data, (maximum 16). */ 00396 unsigned int *data; /* Data of blinking. */ 00397 }; 00398 /* 00399 Parameter structure for the fps_testpower() function. 00400 */ 00401 struct FPSAPI_PARM_TEST_POWER { 00402 int state; /* Device state mask. */ 00403 int level; /* Battery power level. */ 00404 }; 00405 00406 /* 00407 Parameter structure for the fps_testbutton() function. 00408 */ 00409 struct FPSAPI_PARM_TEST_BUTTON { 00410 int code; /* Code of the button. */ 00411 int state; /* State of the button. */ 00412 }; 00413 00414 /* 00415 Parameter structure for the fps_getbuttonevent() function. 00416 */ 00417 struct FPSAPI_PARM_GET_BUTTON_EVENT { 00418 int code; /* Code of the button. */ 00419 int state; /* State of the button. */ 00420 }; 00421 00422 /* 00423 Parameter structure for the fps_beginwindowmessaging() function. 00424 */ 00425 struct FPSAPI_PARM_BEGIN_WINDOW_MESSAGING { 00426 #if defined(WIN32) 00427 HWND hwnd; /* Window handle to send the messages to. */ 00428 UINT base_msg; /* Message id base. */ 00429 #else 00430 int rfu1; 00431 #endif 00432 }; 00433 00434 /* 00435 Parameter structure for the fps_getudinfo() function. 00436 */ 00437 struct FPSAPI_PARM_GET_UDINFO { 00438 int nblocks; /* Number of blocks. */ 00439 int sblock; /* Size of a block. */ 00440 }; 00441 00442 /* 00443 Parameter structure for the fps_readudata() function. 00444 */ 00445 struct FPSAPI_PARM_READ_UD { 00446 int fblock; /* First block to read. */ 00447 int nblocks; /* Number of blocks to read. */ 00448 void *data; /* Bytes read. */ 00449 }; 00450 00451 /* 00452 Parameter structure for the fps_writeudata() function. 00453 */ 00454 struct FPSAPI_PARM_WRITE_UD { 00455 int fblock; /* First block to write. */ 00456 int nblocks; /* Number of blocks to write. */ 00457 const void *data; /* Bytes to write. */ 00458 }; 00459 00460 /* 00461 Parameter structure for the fps_getdeviceinfo() function. 00462 */ 00463 struct FPSAPI_PARM_GETDEVICEINFO { 00464 gxVARIANT devinfo; /* Device info. */ 00465 }; 00466 00467 /* 00468 Parameter structure for the fps_capture() function. 00469 */ 00470 struct FPSAPI_PARM_CAPTURE { 00471 int timeout; /* Timeout. */ 00472 int quality; /* Quality. */ 00473 int mode; /* Capture mode. */ 00474 int fingerlist; /* Finger list. */ 00475 }; 00476 00477 /* 00478 Parameter structure for the fps_capture_start() function. 00479 */ 00480 struct FPSAPI_PARM_CAPTURE_START { 00481 int timeout; /* Timeout. */ 00482 int quality; /* Quality. */ 00483 int mode; /* Capture mode. */ 00484 int fingerlist; /* Finger list. */ 00485 int reqid; /* Returned id for use in fps_capture_getstatus() 00486 and fps_capture_wait() functions. */ 00487 }; 00488 00489 /* 00490 Parameter structure for the fps_fingertonist() function. 00491 */ 00492 struct FPSAPI_PARM_FINGERSTONIST { 00493 const wchar_t *filename; /* The name of the file for saving the data. */ 00494 gxVARIANT fields; /* List of fields to add to the record. */ 00495 }; 00496 00497 /* 00498 Parameter structure for the fps_fingertonista() function. 00499 */ 00500 struct FPSAPI_PARM_FINGERSTONISTA { 00501 const char *filename; /* The name of the file for saving the data. */ 00502 gxVARIANT fields; /* List of fields to add to the record. */ 00503 }; 00504 00505 /* 00506 Parameter structure for the fps_fingertonistmem() function. 00507 */ 00508 struct FPSAPI_PARM_FINGERSTONISTMEM { 00509 void **buffer; /* Pointer to a memory area pointer. */ 00510 gxi32 *buflen; /* Size of memory area. */ 00511 gxVARIANT fields; /* List of fields to add to the record. */ 00512 }; 00513 00514 /* 00515 Parameter structure for the fps_fingerminutiatomem() function. 00516 */ 00517 struct FPSAPI_PARM_FINGERMINUTIARECORDTOMEM { 00518 void **buffer; /* Pointer to a memory area pointer. */ 00519 gxi32 *buflen; /* Size of memory area. */ 00520 gxVARIANT fields; 00521 }; 00522 00523 /* 00524 Parameter structure for the fps_fingerminutiatofile() function. 00525 */ 00526 struct FPSAPI_PARM_FINGERMINUTIARECORDTOFILE { 00527 const wchar_t *filename; /* The name of the file for saving the data. */ 00528 gxVARIANT fields; 00529 }; 00530 00531 /* 00532 Parameter structure for the fps_fingerminutiatofilea() function. 00533 */ 00534 struct FPSAPI_PARM_FINGERMINUTIARECORDTOFILEA { 00535 const char *filename; /* The name of the file for saving the data. */ 00536 gxVARIANT fields; 00537 }; 00538 00539 #endif/* GX_SWIGIF GX_MANUAL )*/ 00540 00541 /******************************************************************************* 00542 * functions 00543 ******************************************************************************/ 00544 00545 #if !defined(NO_GX_FUNCTIONS) && !defined(GX_SWIGIF) /*(*/ 00546 00561 inline int fps_getdevicelist(gxHANDLE handle,wchar_t ***devices,int *ndevices) { 00562 struct FPSAPI_PARM_GETDEVICELIST gdl; 00563 int ret; 00564 assert(devices && ndevices); 00565 ret = gx_call(handle, FPSAPI_CALL_GETDEVICELIST, &gdl); 00566 *devices = gdl.devices; 00567 *ndevices = gdl.ndevices; 00568 return ret; 00569 } 00570 00581 inline int fps_getdevicelista(gxHANDLE handle,char ***devices,int *ndevices) { 00582 struct FPSAPI_PARM_GETDEVICELISTA gdl; 00583 int ret; 00584 assert(devices && ndevices); 00585 ret = gx_call(handle, FPSAPI_CALL_GETDEVICELISTA, &gdl); 00586 *devices = gdl.devices; 00587 *ndevices = gdl.ndevices; 00588 return ret; 00589 } 00590 00591 #ifdef __cplusplus 00592 00602 inline int fps_getdevicelist(gxHANDLE handle,char ***devices,int *ndevices) { 00603 return fps_getdevicelista(handle,devices,ndevices); 00604 } 00605 #endif 00606 00616 inline int fps_usedevice(gxHANDLE handle,const wchar_t *device,int mode) { 00617 struct FPSAPI_PARM_USEDEVICE ud; 00618 assert(device); 00619 ud.device = device; 00620 ud.mode = mode; 00621 return gx_call(handle, FPSAPI_CALL_USEDEVICE, &ud); 00622 } 00623 00633 inline int fps_usedevicea(gxHANDLE handle,const char *device,int mode) { 00634 struct FPSAPI_PARM_USEDEVICEA ud; 00635 assert(device); 00636 ud.device = device; 00637 ud.mode = mode; 00638 return gx_call(handle, FPSAPI_CALL_USEDEVICEA, &ud); 00639 } 00640 00649 inline int fps_usedevicen(gxHANDLE handle,int devno,int mode) { 00650 char **devlist; 00651 int ndev,ret; 00652 assert(devno>=0); 00653 00654 if(!fps_getdevicelista(handle,&devlist,&ndev))return 0; 00655 if(ndev<=devno){ 00656 if(ndev)gx_globalfree(devlist); 00657 gx_seterror(_GX_ENOENT,L"No device found"); 00658 return false; 00659 } 00660 00661 ret=fps_usedevicea(handle,devlist[devno],mode); 00662 gx_globalfree(devlist); 00663 return ret; 00664 } 00665 00666 #ifdef __cplusplus 00667 00677 inline int fps_usedevice(gxHANDLE handle,const char *device,int mode) { 00678 return fps_usedevicea(handle,device,mode); 00679 } 00680 00689 inline int fps_usedevice(gxHANDLE handle,int devno,int mode) { 00690 return fps_usedevicen(handle,devno,mode); 00691 } 00692 #endif 00693 00699 inline int fps_closedevice(gxHANDLE handle) { 00700 struct FPSAPI_PARM_USEDEVICEA ud; 00701 ud.device = 0; 00702 ud.mode=_FPS_UMODE_DISCONNECT; 00703 return gx_call(handle, FPSAPI_CALL_USEDEVICEA, &ud); 00704 } 00705 00716 inline int fps_calibrate(gxHANDLE handle,int windowid GX_DEFARG(0)) { 00717 struct FPSAPI_PARM_CALIBRATE cal; 00718 cal.windowid = windowid; 00719 return gx_call(handle, FPSAPI_CALL_CALIBRATE, &cal); 00720 } 00721 00730 inline int fps_iscalibrated(gxHANDLE handle,int windowid GX_DEFARG(0)) { 00731 struct FPSAPI_PARM_ISCALIBRATED cal; 00732 cal.windowid = windowid; 00733 return gx_call(handle, FPSAPI_CALL_ISCALIBRATED, &cal); 00734 } 00735 00747 inline int fps_testpresence(gxHANDLE handle,int *state,int windowid GX_DEFARG(0)) { 00748 struct FPSAPI_PARM_TEST_PRESENCE td; 00749 int ret; 00750 assert(state); 00751 td.windowid = windowid; 00752 ret = gx_call(handle, FPSAPI_CALL_TEST_PRESENCE, &td); 00753 if(state)*state = td.state; 00754 return ret; 00755 } 00756 00766 inline int fps_setstatusled(gxHANDLE handle, int ledmask, int color) { 00767 struct FPSAPI_PARM_SET_STATUS_LED led; 00768 led.ledmask = ledmask; 00769 led.color = color; 00770 return gx_call(handle, FPSAPI_CALL_SET_STATUS_LED, &led); 00771 } 00772 00787 inline int fps_blinkstatus(gxHANDLE handle, int coding, int mask, int type, int iteration, unsigned int *data, unsigned int datalength) { 00788 00789 struct FPSAPI_PARM_BLINK_STATUS out_data; 00790 00791 out_data.coding = coding; 00792 out_data.mask = mask; 00793 out_data.type = type; 00794 out_data.iteration = iteration; 00795 out_data.data = data; 00796 out_data.datalength = datalength; 00797 00798 return gx_call(handle, FPSAPI_CALL_BLINK_STATUS, &out_data); 00799 } 00808 inline int fps_testpower(gxHANDLE handle, int *state, int *level) { 00809 struct FPSAPI_PARM_TEST_POWER tp; 00810 int ret; 00811 assert(state); 00812 ret = gx_call(handle, FPSAPI_CALL_TEST_POWER, &tp); 00813 if(state)*state = tp.state; 00814 if(level)*level = tp.level; 00815 return ret; 00816 } 00817 00825 inline int fps_testbutton(gxHANDLE handle, int keycode, int *state) { 00826 struct FPSAPI_PARM_TEST_BUTTON bt; 00827 int ret; 00828 assert(state); 00829 bt.code = keycode; 00830 ret = gx_call(handle, FPSAPI_CALL_TEST_BUTTON, &bt); 00831 if(state)*state = bt.state; 00832 return ret; 00833 } 00834 00842 inline int fps_getbuttonevent(gxHANDLE handle, int *keycode, int *state) { 00843 struct FPSAPI_PARM_GET_BUTTON_EVENT bt; 00844 int ret; 00845 assert(state); 00846 assert(keycode); 00847 ret = gx_call(handle, FPSAPI_CALL_GET_BUTTON_EVENT, &bt); 00848 if(state)*state = bt.state; 00849 if(keycode)*keycode = bt.code; 00850 return ret; 00851 } 00852 00863 inline int fps_suspend(gxHANDLE handle) { 00864 return gx_call(handle,FPSAPI_CALL_SUSPEND,0); 00865 } 00866 00873 inline int fps_wakeup(gxHANDLE handle) { 00874 return gx_call(handle,FPSAPI_CALL_WAKEUP,0); 00875 } 00876 00885 inline int fps_getudinfo(gxHANDLE handle, int *nblocks, int *sblock) { 00886 struct FPSAPI_PARM_GET_UDINFO gi; 00887 int ret; 00888 assert(nblocks); 00889 assert(sblock); 00890 ret = gx_call(handle, FPSAPI_CALL_GET_UDINFO, &gi); 00891 if(nblocks)*nblocks = gi.nblocks; 00892 if(sblock)*sblock = gi.sblock; 00893 return ret; 00894 } 00895 00908 inline int fps_readudata(gxHANDLE handle, int fblock, int nblocks, void **data) { 00909 struct FPSAPI_PARM_READ_UD ru; 00910 int ret; 00911 assert(data); 00912 ru.fblock = fblock; 00913 ru.nblocks = nblocks; 00914 ret = gx_call(handle, FPSAPI_CALL_READ_UD, &ru); 00915 if(data)*data = ru.data; 00916 return ret; 00917 } 00918 00928 inline int fps_writeudata(gxHANDLE handle, int fblock, int nblocks, const void *data) { 00929 struct FPSAPI_PARM_WRITE_UD wu; 00930 wu.fblock = fblock; 00931 wu.nblocks = nblocks; 00932 wu.data = data; 00933 return gx_call(handle, FPSAPI_CALL_WRITE_UD, &wu); 00934 } 00935 00943 inline int fps_getdeviceinfo(gxHANDLE handle, gxVARIANT *devinfo) { 00944 struct FPSAPI_PARM_GETDEVICEINFO gdi; 00945 int ret; 00946 assert(devinfo); 00947 ret = gx_call(handle, FPSAPI_CALL_GETDEVICEINFO, &gdi); 00948 if(ret && devinfo)*devinfo = gdi.devinfo; 00949 return ret; 00950 } 00951 00964 inline int fps_seteventfunction(gxHANDLE handle, FPS_EVFUNC *eventhandler, void *param) { 00965 struct FPSAPI_PARM_SETEVENTFUNCTION sef; 00966 sef.func = eventhandler; 00967 sef.param = param; 00968 return gx_call(handle, FPSAPI_CALL_SETEVENTFUNCTION, &sef); 00969 } 00970 00971 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_SWIG) 00972 00990 inline int fps_beginwindowmessaging(gxHANDLE handle, HWND hwnd, UINT base_msg GX_DEFARG(WM_USER)) { 00991 struct FPSAPI_PARM_BEGIN_WINDOW_MESSAGING bwm; 00992 bwm.hwnd = hwnd; 00993 bwm.base_msg = base_msg; 00994 return gx_call(handle,FPSAPI_CALL_BEGIN_WINDOW_MESSAGING,&bwm); 00995 } 00996 01006 inline int fps_endwindowmessaging(gxHANDLE handle) { 01007 return gx_call(handle,FPSAPI_CALL_END_WINDOW_MESSAGING,0); 01008 } 01009 01010 #endif/* WIN32 GX_SWIG */ 01011 01012 #if (defined(LINUX) || defined(GX_MANUAL)) && !defined(GX_SWIG) 01013 01024 inline int fps_startbgprocesses(gxHANDLE handle) { 01025 struct FPSAPI_PARM_BEGIN_WINDOW_MESSAGING bwm; 01026 return gx_call(handle,FPSAPI_CALL_BEGIN_WINDOW_MESSAGING,&bwm); 01027 } 01028 01037 inline int fps_stopbgprocesses(gxHANDLE handle) { 01038 return gx_call(handle,FPSAPI_CALL_END_WINDOW_MESSAGING,0); 01039 } 01040 01041 #endif/* LINUX GX_SWIG */ 01042 01071 inline int fps_capture(gxHANDLE handle, int timeout, int quality, int mode, int fingerlist) { 01072 struct FPSAPI_PARM_CAPTURE param; 01073 param.timeout = timeout; 01074 param.quality = quality; 01075 param.mode = mode; 01076 param.fingerlist = fingerlist; 01077 return gx_call(handle, FPSAPI_CALL_CAPTURE, ¶m); 01078 } 01079 01104 inline int fps_capture_start(gxHANDLE handle, int timeout, int quality, int mode, 01105 int fingerlist, int *reqid) { 01106 struct FPSAPI_PARM_CAPTURE_START param; 01107 int ret; 01108 param.timeout = timeout; 01109 param.quality = quality; 01110 param.mode = mode; 01111 param.fingerlist = fingerlist; 01112 ret = gx_call(handle, FPSAPI_CALL_CAPTURE_START, ¶m); 01113 if(reqid) *reqid = param.reqid; 01114 return ret; 01115 } 01116 01127 inline int fps_capture_getstatus(gxHANDLE handle,int reqid,int *status) { 01128 struct FPSAPI_PARM_GETSTATUS stat; 01129 int ret; 01130 assert(status); 01131 stat.reqid = reqid; 01132 ret = gx_call(handle, FPSAPI_CALL_CAPTURE_GETSTATUS, &stat); 01133 if(status) *status = stat.status; 01134 return ret; 01135 } 01136 01144 inline int fps_capture_stop(gxHANDLE handle) { 01145 return gx_call(handle, FPSAPI_CALL_CAPTURE_STOP, 0); 01146 } 01147 01156 inline int fps_capture_wait(gxHANDLE handle,int reqid) { 01157 struct FPSAPI_PARM_CAPTURE_WAIT cap; 01158 cap.reqid = reqid; 01159 return gx_call(handle, FPSAPI_CALL_CAPTURE_WAIT, &cap); 01160 } 01161 01170 inline int fps_capture_preview(gxHANDLE handle,int windowid GX_DEFARG(0)) { 01171 struct FPSAPI_PARM_CAPTURE_PREVIEW cap; 01172 cap.windowid = windowid; 01173 return gx_call(handle, FPSAPI_CALL_CAPTURE_PREVIEW, &cap); 01174 } 01175 01195 inline int fps_getimage(gxHANDLE handle,int smode,int position,int type,gxVARIANT *img) { 01196 struct FPSAPI_PARM_GETIMAGE_V gi; 01197 int ret; 01198 assert(img); 01199 gi.smode = smode; 01200 gi.position = position; 01201 gi.type = type; 01202 ret = gx_call(handle, FPSAPI_CALL_GETIMAGE_V, &gi); 01203 *img = gi.img; 01204 return ret; 01205 } 01206 01221 inline int fps_saveimage(gxHANDLE handle,int smode,int position,int type,const wchar_t *filename,int filetype) { 01222 struct FPSAPI_PARM_SAVEIMAGE si; 01223 si.smode = smode; 01224 si.position = position; 01225 si.type = type; 01226 si.filename = filename; 01227 si.filetype = filetype; 01228 return gx_call(handle, FPSAPI_CALL_SAVEIMAGE, &si); 01229 } 01230 01246 inline int fps_saveimagea(gxHANDLE handle,int smode,int position,int type,const char *filename,int filetype) { 01247 struct FPSAPI_PARM_SAVEIMAGEA si; 01248 si.smode = smode; 01249 si.position = position; 01250 si.type = type; 01251 si.filename = filename; 01252 si.filetype = filetype; 01253 return gx_call(handle, FPSAPI_CALL_SAVEIMAGEA, &si); 01254 } 01255 01256 #ifdef __cplusplus 01257 01272 inline int fps_saveimage(gxHANDLE handle,int smode,int position,int type,const char *filename,int filetype) { 01273 return fps_saveimagea(handle,smode,position,type,filename,filetype); 01274 } 01275 #endif 01276 01277 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_DOTNET) 01278 01296 inline int fps_drawimage(gxHANDLE handle,int smode,int position,int type,HDC hdc,int x,int y,int xsize,int ysize,gxRCT *frame) { 01297 struct FPSAPI_PARM_DRAWIMAGE di; 01298 di.smode = smode; 01299 di.position = position; 01300 di.type = type; 01301 di.hdc = hdc; 01302 di.x = x; 01303 di.y = y; 01304 di.xsize = xsize; 01305 di.ysize = ysize; 01306 di.frame = frame; 01307 return gx_call(handle, FPSAPI_CALL_DRAWIMAGE, &di); 01308 } 01309 #endif/* WIN32 GX_DOTNET */ 01310 01324 inline int fps_fingertonist(gxHANDLE handle,const wchar_t *filename,gxVARIANT fields) { 01325 struct FPSAPI_PARM_FINGERSTONIST fn; 01326 fn.filename = filename; 01327 fn.fields = fields; 01328 return gx_call(handle, FPSAPI_CALL_FINGERSTONIST, &fn); 01329 } 01330 01338 inline int fps_fingertonista(gxHANDLE handle,const char *filename,gxVARIANT fields) { 01339 struct FPSAPI_PARM_FINGERSTONISTA fn; 01340 fn.filename = filename; 01341 fn.fields = fields; 01342 return gx_call(handle, FPSAPI_CALL_FINGERSTONISTA, &fn); 01343 } 01344 01345 #ifdef __cplusplus 01346 01353 inline int fps_fingertonist(gxHANDLE handle,const char *filename,gxVARIANT fields) { 01354 return fps_fingertonista(handle,filename,fields); 01355 } 01356 #endif 01357 01366 inline int fps_fingertonistmem(gxHANDLE handle,void **buffer, int *buflen,gxVARIANT fields) { 01367 struct FPSAPI_PARM_FINGERSTONISTMEM fn; 01368 fn.buffer = buffer; 01369 fn.buflen = buflen; 01370 fn.fields = fields; 01371 return gx_call(handle, FPSAPI_CALL_FINGERSTONISTMEM, &fn); 01372 } 01373 01374 01383 inline int fps_fingerminutiatomem(gxHANDLE handle,void **buffer, int *buflen,gxVARIANT fields) { 01384 struct FPSAPI_PARM_FINGERMINUTIARECORDTOMEM fm; 01385 fm.buffer = buffer; 01386 fm.buflen = buflen; 01387 fm.fields = fields; 01388 return gx_call(handle, FPSAPI_CALL_FINGERMINUTIATOMEM, &fm); 01389 } 01390 01397 inline int fps_fingerminutiatofile(gxHANDLE handle, const wchar_t *filename, gxVARIANT fields) { 01398 struct FPSAPI_PARM_FINGERMINUTIARECORDTOFILE fm; 01399 fm.filename = filename; 01400 fm.fields = fields; 01401 return gx_call(handle, FPSAPI_CALL_FINGERMINUTIATOFILE, &fm); 01402 } 01403 01410 inline int fps_fingerminutiatofilea(gxHANDLE handle, const char *filename, gxVARIANT fields) { 01411 struct FPSAPI_PARM_FINGERMINUTIARECORDTOFILEA fm; 01412 fm.filename = filename; 01413 fm.fields = fields; 01414 return gx_call(handle, FPSAPI_CALL_FINGERMINUTIATOFILEA, &fm); 01415 } 01416 01417 #ifdef __cplusplus 01418 01424 inline int fps_fingerminutiatofile(gxHANDLE handle,const char *filename, gxVARIANT fields) { 01425 return fps_fingerminutiatofilea(handle,filename, fields); 01426 } 01427 #endif 01428 01437 inline int fps_nistfingerquality(gxHANDLE handle, int *quality, int position) { 01438 struct FPSAPI_PARM_NISTFINGERQUALITY nistqualityparam; 01439 int ret; 01440 nistqualityparam.position = position; 01441 ret = gx_call(handle, FPSAPI_CALL_NISTFINGERQUALITY, &nistqualityparam); 01442 if(ret && quality) *quality = nistqualityparam.quality; 01443 return ret; 01444 } 01445 01457 inline int fps_resetfingerlist(gxHANDLE handle) { 01458 return gx_call(handle, FPSAPI_CALL_RESETFINGERLIST, (void*)0); 01459 } 01460 01461 #endif /*)*/ 01462 01463 #ifdef GX_DOTNET 01464 #pragma managed 01465 #undef gxPG4 01466 #endif 01467 01468 /******************************************************************************/ 01469 #if !defined(NO_GX_CLASSES) /*(*/ 01470 01471 #if !defined(GX_MANUAL) && defined(GX_DOTNET) 01472 //cannot compile without this 01473 private __value struct fps_dotnetfix { gxVARIANT dat; }; 01474 #endif 01475 01480 GX_CLASS FingerPrintScanner : public gxHandle 01481 #ifdef GX_DOTNET 01482 ,public System::IDisposable 01483 #endif 01484 { 01485 01486 public: 01487 01489 inline FingerPrintScanner() throw(gxError) { 01490 #ifndef GX_DOTNET 01491 if(!gx_openmodule(this, L"prapi", L"default")) gxthrow; 01492 #else 01493 GX_GETHANDLE(h); 01494 if(!gx_openmodule(&h, L"prapi", L"default")) gxthrow; 01495 _set_handle(h.handle); 01496 #endif 01497 } 01498 01500 inline void Dispose(void) { 01501 #ifdef GX_DOTNET 01502 System::GC::SuppressFinalize(this); 01503 #endif 01504 gxHandle::Dispose(); 01505 } 01506 01507 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 01508 01518 inline bool GetDeviceList(wchar_t ***devices,int *ndevices) throw(gxError) { 01519 bool st = fps_getdevicelist(*this,devices,ndevices)!=0; 01520 gxcondthrow(!st); 01521 return st; 01522 } 01523 01534 inline bool GetDeviceList(char ***devices,int *ndevices) throw(gxError) { 01535 bool st = fps_getdevicelist(*this,devices,ndevices)!=0; 01536 gxcondthrow(!st); 01537 return st; 01538 } 01539 #endif 01540 01541 #ifdef GX_UNICODE 01542 01546 inline gxOutStrArray GetDeviceList(void) throw(gxError) { 01547 wchar_t **devices; 01548 int ndevices = 0; 01549 GX_GETHANDLE(h); 01550 if(!fps_getdevicelist(h,&devices,&ndevices)) { 01551 gxthrow; 01552 return GX_PUTGSTRINGARRAY_NONE; 01553 } 01554 return GX_PUTGSTRINGARRAY(devices, ndevices, true); 01555 } 01556 #endif 01557 01558 #ifdef GX_ASCII 01559 01563 inline gxOutAStrArray GetDeviceListA(void) throw(gxError) { 01564 char **devices; 01565 int ndevices = 0; 01566 if(!fps_getdevicelist(*this,&devices,&ndevices)) { 01567 gxthrow; 01568 return GX_PUTGASTRINGARRAY_NONE; 01569 } 01570 return GX_PUTGASTRINGARRAY(devices, ndevices, true); 01571 } 01572 #endif 01573 01574 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 01575 01586 inline bool UseDevice(const wchar_t *device,int mode) throw(gxError) { 01587 bool st = fps_usedevice(*this,device,mode)!=0; 01588 gxcondthrow(!st); 01589 return st; 01590 } 01591 01603 inline bool UseDevice(const char *device,int mode) throw(gxError) { 01604 bool st = fps_usedevice(*this,device,mode)!=0; 01605 gxcondthrow(!st); 01606 return st; 01607 } 01608 #endif 01609 01610 #ifdef GX_UNICODE 01611 01622 inline bool UseDevice(gxInStr device,int mode) throw(gxError) { 01623 GX_GETSTRING(_device, device); 01624 GX_GETHANDLE(h); 01625 bool st = fps_usedevice(h, _device,mode)!=0; 01626 gxcondthrow(!st); 01627 return st; 01628 } 01629 #endif 01630 01631 #ifdef GX_ASCII 01632 01643 inline bool UseDevice(gxInAStr device,int mode) throw(gxError) { 01644 GX_GETASTRING(_device, device); 01645 GX_GETHANDLE(h); 01646 bool st = fps_usedevice(h, _device,mode)!=0; 01647 gxcondthrow(!st); 01648 return st; 01649 } 01650 #endif 01651 01661 inline bool UseDevice(int devno,int mode) throw(gxError) { 01662 GX_GETHANDLE(h); 01663 bool st = fps_usedevice(h,devno,mode)!=0; 01664 gxcondthrow(!st); 01665 return st; 01666 } 01667 01673 inline bool CloseDevice(void) throw(gxError) { 01674 GX_GETHANDLE(h); 01675 bool st = fps_closedevice(h)!=0; 01676 gxcondthrow(!st); 01677 return st; 01678 } 01679 01689 inline bool Calibrate(int windowid GX_DEFARG(0)) throw(gxError) { 01690 GX_GETHANDLE(h); 01691 bool st = fps_calibrate(h,windowid)!=0; 01692 gxcondthrow(!st); 01693 return st; 01694 } 01695 01703 inline bool IsCalibrated(int windowid GX_DEFARG(0)) { 01704 GX_GETHANDLE(h); 01705 return fps_iscalibrated(h,windowid)!=0; 01706 } 01707 01718 inline int TestPresence(int windowid GX_DEFARG(0)) { 01719 int state; 01720 GX_GETHANDLE(h); 01721 return fps_testpresence(h,&state,windowid) ? state : -1; 01722 } 01723 01732 inline bool SetStatusLed(int ledmask, int color) throw(gxError) { 01733 GX_GETHANDLE(h); 01734 bool st = fps_setstatusled(h, ledmask, color)!=0; 01735 gxcondthrow(!st); 01736 return st; 01737 } 01738 01739 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 01740 01753 inline bool BlinkStatus(int coding, int mask, int type, int iteration, unsigned int *data, unsigned int datalength) throw(gxError) { 01754 GX_GETHANDLE(h); 01755 bool st = fps_blinkstatus(h, coding, mask, type, iteration, data, datalength)!=0; 01756 gxcondthrow(!st); 01757 return st; 01758 } 01759 #endif 01760 01761 #ifndef NO_GX_STL 01762 01775 inline bool BlinkStatus(int coding, int mask, int type, int iteration, gxInIntArray data) throw(gxError) { 01776 GX_GETHANDLE(h); 01777 GX_GETININTARRAY(data); 01778 bool st = fps_blinkstatus(h, coding, mask, type, iteration,(unsigned int *)GX_GETININTARRAY_PTR(data), GX_GETININTARRAY_LEN(data))!=0; 01779 GX_FREEININTARRAY(data); 01780 gxcondthrow(!st); 01781 return st; 01782 } 01783 #endif 01784 01788 inline int TestPowerState(void) { 01789 int state; 01790 GX_GETHANDLE(h); 01791 return fps_testpower(h,&state,0) ? state : -1; 01792 } 01793 01800 inline int TestPowerLevel(void) { 01801 int state,level; 01802 GX_GETHANDLE(h); 01803 return fps_testpower(h,&state,&level) ? level : -1; 01804 } 01805 01811 inline int TestButton(int keycode) { 01812 int state; 01813 GX_GETHANDLE(h); 01814 return fps_testbutton(h,keycode,&state) ? state : -1; 01815 } 01816 01826 inline bool Suspend() throw(gxError) { 01827 GX_GETHANDLE(h); 01828 bool st = fps_suspend(h)!=0; 01829 gxcondthrow(!st); 01830 return st; 01831 } 01832 01838 inline bool WakeUp() throw(gxError) { 01839 GX_GETHANDLE(h); 01840 bool st = fps_wakeup(h)!=0; 01841 gxcondthrow(!st); 01842 return st; 01843 } 01844 01845 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 01846 01853 inline bool GetUDInfo(int *nblocks, int *sblock) throw(gxError) { 01854 GX_GETHANDLE(h); 01855 bool st = fps_getudinfo(h, nblocks, sblock) != 0; 01856 gxcondthrow(!st); 01857 return st; 01858 } 01859 01871 inline bool ReadUData(int fblock, int nblocks, void **data) throw(gxError) { 01872 GX_GETHANDLE(h); 01873 bool st = fps_readudata(h, fblock, nblocks, data) != 0; 01874 gxcondthrow(!st); 01875 return st; 01876 } 01877 01886 inline bool WriteUData(int fblock, int nblocks, const void *data) throw(gxError) { 01887 GX_GETHANDLE(h); 01888 bool st = fps_writeudata(h, fblock, nblocks, data) != 0; 01889 gxcondthrow(!st); 01890 return st; 01891 } 01892 #else 01893 01901 inline gxOutData ReadUData(int fblock, int nblocks) throw(gxError) { 01902 GX_GETHANDLE(h); 01903 void *data; 01904 if (fps_readudata(h, fblock, nblocks, &data) == 0) { 01905 gxthrow; 01906 return GX_PUTDATA_NONE; 01907 } 01908 int i,sblock; 01909 if (fps_getudinfo(h, &i, &sblock) == 0) { 01910 gxthrow; 01911 return GX_PUTDATA_NONE; 01912 } 01913 i=nblocks*sblock; 01914 gxOutData od = GX_PUTDATA(data, i); 01915 if(data) gx_globalfree(data); 01916 return od; 01917 } 01918 01927 inline bool WriteUData(int fblock, int nblocks, gxInData data) throw(gxError) { 01928 GX_GETHANDLE(h); 01929 GX_GETDATA(data); 01930 bool st = fps_writeudata(h, fblock, nblocks, GX_DATAPTR(data)) != 0; 01931 gxcondthrow(!st); 01932 return st; 01933 } 01934 #endif /* GX_SWIG && GX_DOTNET */ 01935 01941 inline int GetUDNumberOfBlocks(void) throw(gxError) { 01942 GX_GETHANDLE(h); 01943 int nblocks; 01944 int sblock; 01945 bool st = fps_getudinfo(h, &nblocks, &sblock) != 0; 01946 gxcondthrow(!st); 01947 return st ? nblocks : -1; 01948 } 01949 01955 inline int GetUDBlockSize(void) throw(gxError) { 01956 GX_GETHANDLE(h); 01957 int nblocks; 01958 int sblock; 01959 bool st = fps_getudinfo(h, &nblocks, &sblock) != 0; 01960 gxcondthrow(!st); 01961 return st ? sblock : -1; 01962 } 01963 01968 inline gxVariant * GetDeviceInfo() throw(gxError) { 01969 GX_GETHANDLE(h); 01970 gxVARIANT d; 01971 bool st = fps_getdeviceinfo(h,&d) != 0; 01972 gxcondthrow(!st); 01973 if(st) gxSystem::ClearError(); 01974 if(!d) return 0; 01975 #ifndef GX_DOTNET 01976 gxVariant * vr = new gxVariant(d); 01977 gx_unrefvariant(d); 01978 #else 01979 gxVariant * vr = new gxVariant(); 01980 vr->_set_variant(d); 01981 #endif 01982 if(!vr){gxSystem::SetError(GXEC GX_ENOMEM);gxthrow;} 01983 return vr; 01984 } 01985 01986 #if !defined(GX_SWIGIF) && !defined(GX_DOTNET) 01987 01998 inline bool SetEventFunction(FPS_EVFUNC *eventhandler,void *param) { 01999 return fps_seteventfunction(*this,eventhandler,param)!=0; 02000 } 02001 #endif 02002 02003 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_SWIG) 02004 02021 #ifndef GX_DOTNET 02022 inline bool BeginWindowMessaging(HWND hwnd, UINT base_msg GX_DEFARG(WM_USER)) throw(gxError) { 02023 bool st = fps_beginwindowmessaging(*this,hwnd, base_msg)!=0; 02024 gxcondthrow(!st); 02025 return st; 02026 } 02027 #else 02028 inline bool BeginWindowMessaging(gxInPtr hwnd, UINT base_msg GX_DEFARG(WM_USER)) throw(gxError) { 02029 GX_GETHANDLE(h); 02030 bool st = fps_beginwindowmessaging(h,hwnd.ToPointer(), base_msg)!=0; 02031 gxcondthrow(!st); 02032 return st; 02033 } 02034 #endif 02035 02044 inline bool EndWindowMessaging() throw(gxError) { 02045 GX_GETHANDLE(h); 02046 bool st = fps_endwindowmessaging(h)!=0; 02047 gxcondthrow(!st); 02048 return st; 02049 } 02050 02051 #endif/* WIN32 GX_SWIG */ 02052 02053 #if (defined(LINUX) || defined(GX_MANUAL)) && !defined(GX_SWIG) 02054 02064 inline int StartBGProcesses() throw(gxError) { 02065 bool st = fps_startbgprocesses(*this); 02066 gxcondthrow(!st); 02067 return st; 02068 } 02069 02077 inline int StopBGProcesses() { 02078 return fps_stopbgprocesses(*this); 02079 } 02080 02081 #endif/* LINUX GX_SWIG */ 02082 02104 inline bool Capture(int timeout, int quality, int mode, int fingerlist) throw(gxError) { 02105 GX_GETHANDLE(h); 02106 bool st = fps_capture(h, timeout, quality, mode, fingerlist)!=0; 02107 gxcondthrow(!st); 02108 return st; 02109 } 02110 02134 inline int CaptureStart(int timeout, int quality, int mode, int fingerlist) throw(gxError) { 02135 GX_GETHANDLE(h); 02136 int reqid; 02137 bool st = fps_capture_start(h, timeout, quality, mode, fingerlist, &reqid)!=0; 02138 gxcondthrow(!st); 02139 return st ? reqid : -1; 02140 } 02141 02152 inline int CaptureStatus(int reqid) throw(gxError) { 02153 GX_GETHANDLE(h); 02154 int status; 02155 bool st = fps_capture_getstatus(h,reqid,&status)!=0; 02156 gxcondthrow(!st); 02157 return st ? status : -1; 02158 } 02159 02168 inline bool CaptureStop() throw(gxError) { 02169 GX_GETHANDLE(h); 02170 bool st = fps_capture_stop(h)!=0; 02171 gxcondthrow(!st); 02172 return st; 02173 } 02174 02183 inline bool CaptureWait(int reqid) throw(gxError) { 02184 GX_GETHANDLE(h); 02185 bool st = fps_capture_wait(h,reqid)!=0; 02186 gxcondthrow(!st); 02187 return st; 02188 } 02189 02200 inline bool CapturePreview(int windowid GX_DEFARG(0)) throw(gxError) { 02201 GX_GETHANDLE(h); 02202 bool st = fps_capture_preview(h,windowid)!=0; 02203 gxcondthrow(!st); 02204 return st; 02205 } 02206 02223 inline gxVariant * GetImage(int smode,int position,int type) throw(gxError) { 02224 gxVARIANT img = 0; 02225 gxVariant *vimg = 0; 02226 GX_GETHANDLE(h); 02227 if(!fps_getimage(h,smode,position,type,&img)) { 02228 gxthrow; 02229 return vimg; 02230 } 02231 02232 #if !defined(GX_DOTNET) && !defined(GX_SWIG) 02233 if(img) 02234 #endif 02235 #ifndef GX_DOTNET 02236 { 02237 vimg = new gxVariant(img); 02238 if(img)gx_unrefvariant(img); 02239 } 02240 #else 02241 { 02242 vimg = new gxVariant(); 02243 vimg->_set_variant(img); 02244 } 02245 #endif 02246 #if !defined(GX_DOTNET) && !defined(GX_SWIG) 02247 if(img) 02248 #endif 02249 if(!vimg){gxSystem::SetError(GX_ENOMEM);gxthrow;} 02250 if(!img) gxSystem::ClearError(); 02251 return vimg; 02252 } 02253 02254 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 02255 02269 inline bool SaveImage(int smode,int position,int type,const wchar_t *filename,int filetype) throw(gxError) { 02270 bool st = fps_saveimage(*this,smode,position,type,filename,filetype)!=0; 02271 gxcondthrow(!st); 02272 return st; 02273 } 02274 02290 inline bool SaveImage(int smode,int position,int type,const char *filename,int filetype) throw(gxError) { 02291 bool st = fps_saveimage(*this,smode,position,type,filename,filetype)!=0; 02292 gxcondthrow(!st); 02293 return st; 02294 } 02295 #endif 02296 02297 #ifdef GX_UNICODE 02298 02313 inline bool SaveImage(int smode,int position,int type,gxInStr filename,int filetype) throw(gxError) { 02314 GX_GETHANDLE(h); 02315 GX_GETSTRING(_filename, filename); 02316 bool st = fps_saveimage(h,smode,position,type,_filename,filetype)!=0; 02317 gxcondthrow(!st); 02318 return st; 02319 } 02320 #endif 02321 02322 #ifdef GX_ASCII 02323 02338 inline bool SaveImage(int smode,int position,int type,gxInAStr filename,int filetype) throw(gxError) { 02339 GX_GETHANDLE(h); 02340 GX_GETASTRING(_filename, filename); 02341 bool st = fps_saveimage(h,smode,position,type,_filename,filetype)!=0; 02342 gxcondthrow(!st); 02343 return st; 02344 } 02345 #endif 02346 02347 #if (defined(WIN32) || defined(GX_MANUAL)) && !defined(GX_DOTNET) && !defined(GX_SWIG) 02348 02366 inline bool DisplayImage(int smode,int position,int type,HDC hdc,int x,int y,int xsize,int ysize,gxRCT *frame) throw(gxError) { 02367 bool st = fps_drawimage(*this,smode,position,type,hdc,x,y,xsize,ysize,frame)!=0; 02368 gxcondthrow(!st); 02369 return st; 02370 } 02371 #endif 02372 02373 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 02374 02380 inline bool FingerToNist(const wchar_t *filename,gxVariant *fields) throw(gxError) { 02381 bool st = fps_fingertonist(*this,filename,(fields)?fields->_variant:0)!=0; 02382 gxcondthrow(!st); 02383 return st; 02384 } 02385 02392 inline bool FingerToNist(const char *filename,gxVariant *fields) throw(gxError) { 02393 bool st = fps_fingertonist(*this,filename,(fields)?fields->_variant:0)!=0; 02394 gxcondthrow(!st); 02395 return st; 02396 } 02397 02405 inline bool FingerToNistMem(void **buffer, int *buflen,gxVariant *fields) throw(gxError) { 02406 bool st = fps_fingertonistmem(*this,buffer,buflen,fields?fields->_variant:0)!=0; 02407 gxcondthrow(!st); 02408 return st; 02409 } 02410 #endif 02411 02412 #ifdef GX_UNICODE 02413 02419 inline bool FingerToNist(gxInStr filename,gxVariant *fields) throw(gxError) { 02420 GX_GETHANDLE(h); 02421 #ifdef GX_DOTNET 02422 gxVARIANT var = fields?(gxVARIANT)GX_GETPTR(fields->_get_variant()):0; 02423 #else 02424 gxVARIANT var = fields?fields->_variant:0; 02425 #endif 02426 GX_GETSTRING(_filename, filename); 02427 bool st = fps_fingertonist(h,_filename,var)!=0; 02428 gxcondthrow(!st); 02429 return st; 02430 } 02431 #endif 02432 02433 #ifdef GX_ASCII 02434 02440 inline bool FingerToNist(gxInAStr filename,gxVariant *fields) throw(gxError) { 02441 GX_GETHANDLE(h); 02442 GX_GETASTRING(_filename, filename); 02443 bool st = fps_fingertonist(h,_filename,(fields)?fields->_variant:0)!=0; 02444 gxcondthrow(!st); 02445 return st; 02446 } 02447 #endif 02448 02449 #if defined(GX_SWIG) || defined(GX_DOTNET) 02450 02454 inline gxOutData FingerToNistMem(gxVariant *fields) throw(gxError) { 02455 void *buffer = (void *)0; 02456 gxi32 buflen = 0; 02457 GX_GETHANDLE(h); 02458 #ifdef GX_DOTNET 02459 gxVARIANT var = fields?(gxVARIANT)GX_GETPTR(fields->_get_variant()):0; 02460 #else 02461 gxVARIANT var = fields?fields->_variant:0; 02462 #endif 02463 if(!fps_fingertonistmem(h,&buffer,&buflen,var)) { 02464 gxthrow; 02465 return GX_PUTDATA_NONE; 02466 } 02467 gxOutData ret = GX_PUTDATA(buffer, buflen); 02468 if(buffer) gx_globalfree(buffer); 02469 return ret; 02470 } 02471 #endif 02472 02473 02474 02475 #if !defined(GX_SWIG) && !defined(GX_DOTNET) 02476 02482 inline bool FingerMinutiaToFile(const wchar_t *filename, gxVariant *fields) throw(gxError) { 02483 bool st = fps_fingerminutiatofile(*this,filename, (fields)?fields->_variant:0)!=0; 02484 gxcondthrow(!st); 02485 return st; 02486 } 02487 02494 inline bool FingerMinutiaToMem(const char *filename, gxVariant *fields) throw(gxError) { 02495 bool st = fps_fingerminutiatofilea(*this,filename,(fields)?fields->_variant:0)!=0; 02496 gxcondthrow(!st); 02497 return st; 02498 } 02499 02507 inline bool FingerMinutiaToMem(void **buffer, int *buflen, gxVariant *fields) throw(gxError) { 02508 bool st = fps_fingerminutiatomem(*this,buffer,buflen,(fields)?fields->_variant:0)!=0; 02509 gxcondthrow(!st); 02510 return st; 02511 } 02512 #endif 02513 02514 #ifdef GX_UNICODE 02515 02521 inline bool FingerMinutiaToFile(gxInStr filename, gxVariant *fields) throw(gxError) { 02522 GX_GETHANDLE(h); 02523 GX_GETSTRING(_filename, filename); 02524 bool st = fps_fingerminutiatofile(h,_filename,(fields)?fields->_variant:0)!=0; 02525 gxcondthrow(!st); 02526 return st; 02527 } 02528 #endif 02529 02530 #ifdef GX_ASCII 02531 02537 inline bool FingerMinutiaToFile(gxInAStr filename,gxVariant *fields) throw(gxError) { 02538 GX_GETHANDLE(h); 02539 GX_GETASTRING(_filename, filename); 02540 bool st = fps_fingerminutiatofile(h,_filename,(fields)?fields->_variant:0)!=0; 02541 gxcondthrow(!st); 02542 return st; 02543 } 02544 #endif 02545 02546 #if defined(GX_SWIG) || defined(GX_DOTNET) 02547 02551 inline gxOutData FingerMinutiaToMem(gxVariant *fields) throw(gxError) { 02552 void *buffer = (void *)0; 02553 gxi32 buflen = 0; 02554 GX_GETHANDLE(h); 02555 #ifdef GX_DOTNET 02556 gxVARIANT var = fields?(gxVARIANT)GX_GETPTR(fields->_get_variant()):0; 02557 #else 02558 gxVARIANT var = fields?fields->_variant:0; 02559 #endif 02560 if(!fps_fingerminutiatomem(h,&buffer,&buflen,var)) { 02561 gxthrow; 02562 return GX_PUTDATA_NONE; 02563 } 02564 gxOutData ret = GX_PUTDATA(buffer, buflen); 02565 if(buffer) gx_globalfree(buffer); 02566 return ret; 02567 } 02568 #endif 02569 02578 inline int NistFingerQuality(int position) throw(gxError) { 02579 int quality; 02580 GX_GETHANDLE(h); 02581 if(!fps_nistfingerquality(h, &quality, position)) quality = -1; 02582 gxcondthrow(quality<0); 02583 return quality; 02584 } 02585 02595 inline bool ResetFingerList(void) throw(gxError) { 02596 GX_GETHANDLE(h); 02597 bool st = fps_resetfingerlist(h)!=0; 02598 gxcondthrow(!st); 02599 return st; 02600 } 02601 }; 02602 02603 /******************************************************************************/ 02604 #endif/* NO_GX_CLASSES )*/ 02605 /******************************************************************************/ 02606 #ifdef GX_NAMESPACES 02607 } 02608 #endif 02609 /******************************************************************************/ 02610 #ifdef __BORLANDC__ 02611 #pragma warn .rch 02612 #endif 02613 #ifdef _MSC_VER 02614 #pragma warning(pop) 02615 #endif 02616 /******************************************************************************/ 02617 #endif/* FPSAPI_INCL */