FingerDev.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef FINGERDEV_H
  2. #define FINGERDEV_H
  3. //#include "FpDriver.h"
  4. #include "serial.h"
  5. #include "public.h"
  6. #include "smutex.h"
  7. #define LS_ERROR_SUCCESS (1) //成功
  8. #define LS_ERROR_MATCH (0) //比对失败
  9. #define LS_ERROR_INVALID_PARAMETER (-1) //参数错误
  10. #define LS_ERROR_NOT_ENOUGH_MEMORY (-2) //内存分配失败,没有分配到足够的内存
  11. #define LS_ERROR_NOT_SUPPORT_FUNCTION (-3) //功能未实现
  12. #define LS_ERROR_DEVICE_NOT_FOUND (-4) //设备不存在
  13. #define LS_ERROR_DEVICE_NOT_INIT (-5) //设备未初始化
  14. #define LS_ERROR_INVALIDE_CODE (-6) //非法错误号
  15. #define LS_ERROR_OTHERERROR (-9) //其它错误
  16. #define LS_ERROR_TIMEOUT (-7) //超时
  17. #define LS_ERROR_FEATURE (-11) //特征错误
  18. #define LS_ERROR_TEMPLATE (-12) //模板错误
  19. #define LS_ERROR_KEY (-13) //密钥错误
  20. #define LS_ERROR_IMAGE_ERR (-14) //图像错误
  21. typedef char* (*WELLGetErrorInfo)(int nRetCode);
  22. typedef int (*WELLDeviceInit)(void);
  23. typedef int (*WELLDeviceClose)(void);
  24. typedef int (*WELLGetFingerprintAndMatch)(char *psRegBuf, int nTimeout);
  25. typedef int (*WELLGetFeature)(int nFinPos, int nTimeout, char *psVerBuf);
  26. typedef int (*WELLGetTemplate)(int nFinPos, int nTimeout, char *psRegBuf);
  27. // typedef int (*WELLFingerImageDecompress)(char *psCompressedFI,int nTimeout, char *psUnCompressedFI);
  28. // typedef int (*WELLLoadMainKey) (int iAlgorithm, int iMainKeyId, char *psKey, int nTimeout);
  29. // typedef int (*WELLLoadWorkKey) (int iMainKeyId, int iWorkKeyType, int iWorkKeyId, char *psKey, int nTimeout);
  30. // typedef int (*WELLCalculateData)(int iMode,int iWorkKeyId, char *psData, char *psCalculateData);
  31. // typedef int (*WELLFormatKey)(int nChannel);
  32. // typedef int (*WELLisKeyExist)(int iKeyType, int iKeyId);
  33. typedef int (*WELLMatch)( char *psRegBuf, char *psVerBuf, int iLevel);
  34. typedef int (*WELLGetVersion)( char *psRegBuf, char *psVerBuf);
  35. typedef int (*WELLImg2Bmp)(int nTimeOut, char* psBmpFile);
  36. typedef int (*WELLBmp2Feature)(int nFinPos, char* psImgPath1, char* psTZ, int* lpLength);
  37. typedef int (*WELLBmp2Template)(int nFinPos, char *psImgPath1, char *psImgPath2, char *psImgPath3, char *psMB, int *lpLength);
  38. typedef void( *WELLCancel)();
  39. class FingerDev
  40. {
  41. public:
  42. FingerDev();
  43. ~FingerDev();
  44. public:
  45. int Open(const char* sPathFile);
  46. int Close();
  47. int Reset();
  48. int GetFPIImg2Bmp(char *psImgPath);
  49. int GetFPIBmp2Feature(const char* imagePath, LPBYTE lpbFeature, int &iLength);
  50. int GetFPIBmp2Template(const char* imagePath1, const char* imagePath2, const char* imagePath3, LPBYTE lpbTemplate, int &iLength);
  51. int FPIMatch(LPBYTE lpbTemplate, LPBYTE lbpFeature, int level);
  52. int Cancel();
  53. int GetErrInfo(char* errMsg, int iRet);
  54. int GetVersion(char* ver);
  55. private:
  56. int Load_so(const char* sPathFile);
  57. int UnLoad_so();
  58. private:
  59. WELLGetErrorInfo pWELLGetErrorInfo;
  60. WELLDeviceInit pWELLDeviceInit;
  61. WELLDeviceClose pWELLDeviceClose;
  62. //WELLGetFingerprintAndMatch pWELLGetFingerprintAndMatch;
  63. WELLGetFeature pWELLGetFeature;
  64. WELLGetTemplate pWELLGetTemplate;
  65. // WELLFingerImageDecompress pWELLFingerImageDecompress;
  66. // WELLLoadMainKey pWELLLoadMainKey;
  67. // WELLLoadWorkKey pWELLLoadWorkKey;
  68. // WELLCalculateData pWELLCalculateData;
  69. // WELLFormatKey pWELLFormatKey;
  70. // WELLisKeyExist pWELLisKeyExist;
  71. WELLMatch pWELLMatch;
  72. WELLGetVersion pWELLGetVersion;
  73. WELLImg2Bmp pWELLImg2Bmp;
  74. WELLBmp2Feature pWELLBmp2Feature;
  75. WELLBmp2Template pWELLBmp2Template;
  76. WELLCancel pWELLCancel;
  77. HINSTANCE m_hDll;
  78. int m_iPort;
  79. };
  80. #endif // FINGERDEV_H