Biometric Middleware Server  0.0.1
Manage database management for biometrics and identification based on biometrics.
dpfj.h
Go to the documentation of this file.
1 
13 #ifndef __DPFJ_H__
14 #define __DPFJ_H__
15 
16 
18 #ifndef DPAPICALL
19 # if defined(_WIN32) || defined(_WIN64)
20 # ifdef WINCE
21 # define DPAPICALL __cdecl
22 # else
23 # define DPAPICALL __stdcall
24 # endif
25 # else
26 # define DPAPICALL
27 # endif
28 #endif
29 
30 #ifndef NULL
31 # ifdef __cplusplus
32 # define NULL 0
33 # else
34 # define NULL ((void *)0)
35 # endif
36 #endif
37 
38 #ifndef DPERROR
39 # define _DP_FACILITY 0x05BA
40 # define DPERROR(err) ((int)err | (_DP_FACILITY << 16))
41 #endif /* DPERROR */
42 
43 #define DPFJ_API_VERSION_MAJOR 1
44 #define DPFJ_API_VERSION_MINOR 0
45 
48 /****************************************************************************************************
49  Error codes
50 ****************************************************************************************************/
51 
55 #define DPFJ_SUCCESS 0
56 
60 #define DPFJ_E_NOT_IMPLEMENTED DPERROR(0x0a)
61 
67 #define DPFJ_E_FAILURE DPERROR(0x0b)
68 
72 #define DPFJ_E_NO_DATA DPERROR(0x0c)
73 
77 #define DPFJ_E_MORE_DATA DPERROR(0x0d)
78 
82 #define DPFJ_E_INVALID_PARAMETER DPERROR(0x14)
83 
87 #define DPFJ_E_INVALID_FID DPERROR(0x65)
88 
92 #define DPFJ_E_TOO_SMALL_AREA DPERROR(0x66)
93 
97 #define DPFJ_E_INVALID_FMD DPERROR(0xc9)
98 
102 #define DPFJ_E_ENROLLMENT_IN_PROGRESS DPERROR(0x12d)
103 
107 #define DPFJ_E_ENROLLMENT_NOT_STARTED DPERROR(0x12e)
108 
112 #define DPFJ_E_ENROLLMENT_NOT_READY DPERROR(0x12f)
113 
117 #define DPFJ_E_ENROLLMENT_INVALID_SET DPERROR(0x130)
118 
119 /****************************************************************************************************
120  Data types and definitions
121 ****************************************************************************************************/
122 
126 #define DPFJ_PROBABILITY_ONE 0x7fffffff
127 
131 typedef int DPFJ_FID_FORMAT;
132 
133 #define DPFJ_FID_ANSI_381_2004 0x001B0401
134 #define DPFJ_FID_ISO_19794_4_2005 0x01010007
139 typedef int DPFJ_FMD_FORMAT;
140 
141 #define DPFJ_FMD_ANSI_378_2004 0x001B0001
142 #define DPFJ_FMD_ISO_19794_2_2005 0x01010001
143 #define DPFJ_FMD_DP_PRE_REG_FEATURES 0
144 #define DPFJ_FMD_DP_REG_FEATURES 1
145 #define DPFJ_FMD_DP_VER_FEATURES 2
146 #define DPFJ_FMD_DP_PLATINUM_REG_FEATURES 3
152 typedef int DPFJ_FINGER_POSITION;
153 
154 #define DPFJ_POSITION_UNKNOWN 0
155 #define DPFJ_POSITION_RTHUMB 1
156 #define DPFJ_POSITION_RINDEX 2
157 #define DPFJ_POSITION_RMIDDLE 3
158 #define DPFJ_POSITION_RRING 4
159 #define DPFJ_POSITION_RLITTLE 5
160 #define DPFJ_POSITION_LTHUMB 6
161 #define DPFJ_POSITION_LINDEX 7
162 #define DPFJ_POSITION_LMIDDLE 8
163 #define DPFJ_POSITION_LRING 9
164 #define DPFJ_POSITION_LLITTLE 10
171 typedef int DPFJ_SCAN_TYPE;
172 
173 #define DPFJ_SCAN_LIVE_PLAIN 0
174 #define DPFJ_SCAN_LIVE_ROLLED 1
175 #define DPFJ_SCAN_NONLIVE_PLAIN 2
176 #define DPFJ_SCAN_NONLIVE_ROLLED 3
177 #define DPFJ_SCAN_SWIPE 8
182 typedef int DPFJ_ENGINE_TYPE;
183 
184 #define DPFJ_ENGINE_DPFJ 0
185 #define DPFJ_ENGINE_INNOVATRICS_ANSIISO 1
186 #define DPFJ_ENGINE_DPFJ7 2
193 typedef void* DPFJ_DEV;
194 
195 
197 #define DPFJ_FID_ANSI_381_2004_RECORD_HEADER_LENGTH 36
198 #define DPFJ_FID_ISO_19794_4_2005_RECORD_HEADER_LENGTH 32
199 #define DPFJ_FID_ANSI_ISO_VIEW_HEADER_LENGTH 14
200 
201 #define DPFJ_FMD_ANSI_378_2004_RECORD_HEADER_LENGTH 26
202 #define DPFJ_FMD_ISO_19794_2_2005_RECORD_HEADER_LENGTH 24
203 #define DPFJ_FMD_ANSI_ISO_VIEW_HEADER_LENGTH 4
204 #define DPFJ_FMD_ANSI_ISO_MINITIA_LENGTH 6
205 
210 #define MAX_FMD_SIZE (DPFJ_FMD_ANSI_378_2004_RECORD_HEADER_LENGTH + DPFJ_FMD_ANSI_ISO_VIEW_HEADER_LENGTH + 255 * DPFJ_FMD_ANSI_ISO_MINITIA_LENGTH + 2)
211 
215 typedef struct dpfj_ver_info {
216  int major;
217  int minor;
219 } DPFJ_VER_INFO;
220 
224 typedef struct dpfj_version {
225  unsigned int size;
228 } DPFJ_VERSION;
229 
233 typedef struct dpfj_candidate{
234  unsigned int size;
235  unsigned int fmd_idx;
236  unsigned int view_idx;
238 
239 
240 /****************************************************************************************************
241  API calls
242 ****************************************************************************************************/
243 
244 #ifdef __cplusplus
245 extern "C" {
246 #endif /* __cplusplus */
247 
255  int DPAPICALL dpfj_version(
256  DPFJ_VERSION* ver
257  );
258 
271  int DPAPICALL dpfj_select_engine(
272  DPFJ_DEV hdev,
273  DPFJ_ENGINE_TYPE engine
274  );
275 
276 
308  int DPAPICALL dpfj_create_fmd_from_raw (
309  const unsigned char* image_data,
310  unsigned int image_size,
311  unsigned int image_width,
312  unsigned int image_height,
313  unsigned int image_dpi,
314  DPFJ_FINGER_POSITION finger_pos,
315  unsigned int cbeff_id,
316  DPFJ_FMD_FORMAT fmd_type,
317  unsigned char* fmd,
318  unsigned int* fmd_size
319  );
320 
346  int DPAPICALL dpfj_create_fmd_from_fid (
347  DPFJ_FID_FORMAT fid_type,
348  const unsigned char* fid,
349  unsigned int fid_size,
350  DPFJ_FMD_FORMAT fmd_type,
351  unsigned char* fmd,
352  unsigned int* fmd_size
353  );
354 
379  int DPAPICALL dpfj_compare(
380  DPFJ_FMD_FORMAT fmd1_type,
381  unsigned char* fmd1,
382  unsigned int fmd1_size,
383  unsigned int fmd1_view_idx,
384  DPFJ_FMD_FORMAT fmd2_type,
385  unsigned char* fmd2,
386  unsigned int fmd2_size,
387  unsigned int fmd2_view_idx,
388  unsigned int* score
389  );
390 
418  int DPAPICALL dpfj_identify(
419  DPFJ_FMD_FORMAT fmd1_type,
420  unsigned char* fmd1,
421  unsigned int fmd1_size,
422  unsigned int fmd1_view_idx,
423  DPFJ_FMD_FORMAT fmds_type,
424  unsigned int fmds_cnt,
425  unsigned char** fmds,
426  unsigned int* fmds_size,
427  unsigned int threshold_score,
428  unsigned int* candidate_cnt,
429  DPFJ_CANDIDATE* candidates
430  );
431 
441  int DPAPICALL dpfj_start_enrollment(
442  DPFJ_FMD_FORMAT fmd_type
443  );
444 
461  int DPAPICALL dpfj_add_to_enrollment(
462  DPFJ_FMD_FORMAT fmd_type,
463  unsigned char* fmd,
464  unsigned int fmd_size,
465  unsigned int fmd_view_idx
466  );
467 
491  int DPAPICALL dpfj_create_enrollment_fmd(
492  unsigned char* fmd,
493  unsigned int* fmd_size
494  );
495 
503  int DPAPICALL dpfj_finish_enrollment();
504 
518  int DPAPICALL dpfj_fmd_convert(
519  DPFJ_FMD_FORMAT fmd1_type,
520  unsigned char* fmd1,
521  unsigned int fmd1_size,
522  DPFJ_FMD_FORMAT fmd2_type,
523  unsigned char* fmd2,
524  unsigned int* fmd2_size
525  );
526 
527  /****************************************************************************************************
528  legacy DigitalPersona image format conversion
529  ****************************************************************************************************/
530 
544  int DPAPICALL dpfj_dp_fid_convert(
545  const unsigned char* dp_image,
546  unsigned int dp_image_size,
547  DPFJ_FID_FORMAT fid_type,
548  unsigned int fid_dpi,
549  unsigned int rotate180,
550  unsigned char* fid,
551  unsigned int* fid_size
552  );
553 
554  /****************************************************************************************************
555  raw image format conversion
556  ****************************************************************************************************/
557 
576  int DPAPICALL dpfj_raw_convert(
577  const unsigned char* image_data,
578  unsigned int image_size,
579  unsigned int image_width,
580  unsigned int image_height,
581  unsigned int image_dpi,
582  DPFJ_FINGER_POSITION finger_pos,
583  unsigned int cbeff_id,
584  DPFJ_FID_FORMAT fid_type,
585  unsigned int fid_dpi,
586  unsigned int rotate180,
587  unsigned char* fid,
588  unsigned int* fid_size
589  );
590 
591  /****************************************************************************************************
592  FID and FMD manipulation: types and definitions
593  ****************************************************************************************************/
594 
601  typedef struct dpfj_fid_record_params{
602  unsigned int record_length;
603  unsigned int cbeff_id;
604  unsigned int capture_device_id;
605  unsigned int acquisition_level;
606  unsigned int finger_cnt;
607  unsigned int scale_units;
608  unsigned int scan_res;
609  unsigned int image_res;
610  unsigned int bpp;
611  unsigned int compression;
613 
620  typedef struct dpfj_fid_view_params{
621  unsigned int data_length;
623  unsigned int view_cnt;
624  unsigned int view_number;
625  unsigned int quality;
627  unsigned int width;
628  unsigned int height;
629  unsigned char* view_data;
631 
638  typedef struct dpfj_fmd_record_params{
639  unsigned int record_length;
640  unsigned int cbeff_id;
641  unsigned int capture_equipment_comp;
642  unsigned int capture_equipment_id;
643  unsigned int width;
644  unsigned int height;
645  unsigned int resolution;
646  unsigned int view_cnt;
648 
655  typedef struct dpfj_fmd_view_params{
657  unsigned int view_number;
659  unsigned int quality;
660  unsigned int minutia_cnt;
661  unsigned int ext_block_length;
662  unsigned char* ext_block;
664 
665  /****************************************************************************************************
666  FID manipulation
667  ****************************************************************************************************/
668 
677  void DPAPICALL dpfj_get_fid_record_params(
678  DPFJ_FID_FORMAT image_type,
679  const unsigned char* image,
680  DPFJ_FID_RECORD_PARAMS* params
681  );
682 
691  void DPAPICALL dpfj_set_fid_record_params(
692  const DPFJ_FID_RECORD_PARAMS* params,
693  DPFJ_FID_FORMAT image_type,
694  unsigned char* image
695  );
696 
705  unsigned int DPAPICALL dpfj_get_fid_view_offset(
706  DPFJ_FID_FORMAT image_type,
707  const unsigned char* image,
708  unsigned int view_idx
709  );
710 
718  void DPAPICALL dpfj_get_fid_view_params(
719  const unsigned char* view,
720  DPFJ_FID_VIEW_PARAMS* params
721  );
722 
730  void DPAPICALL dpfj_set_fid_view_params(
731  const DPFJ_FID_VIEW_PARAMS* params,
732  unsigned char* view
733  );
734 
735  /****************************************************************************************************
736  FMD manipulation
737  ****************************************************************************************************/
738 
747  void DPAPICALL dpfj_get_fmd_record_params(
748  DPFJ_FMD_FORMAT fmd_type,
749  const unsigned char* fmd,
750  DPFJ_FMD_RECORD_PARAMS* params
751  );
752 
760  void DPAPICALL dpfj_set_fmd_record_params(
761  const DPFJ_FMD_RECORD_PARAMS* params,
762  DPFJ_FMD_FORMAT fmd_type,
763  unsigned char* fmd
764  );
765 
774  unsigned int DPAPICALL dpfj_get_fmd_view_offset(
775  DPFJ_FMD_FORMAT fmd_type,
776  const unsigned char* fmd,
777  unsigned int view_idx
778  );
779 
787  void DPAPICALL dpfj_get_fmd_view_params(
788  const unsigned char* view,
789  DPFJ_FMD_VIEW_PARAMS* params
790  );
791 
799  void DPAPICALL dpfj_set_fmd_view_params(
800  const DPFJ_FMD_VIEW_PARAMS* params,
801  unsigned char* view
802  );
803 
804 
805 #ifdef __cplusplus
806 }
807 #endif /* __cplusplus */
808 
809 #endif /* __DPFJ_H__ */
int DPFJ_ENGINE_TYPE
Defines matching engine to use.
Definition: dpfj.h:182
void DPAPICALL dpfj_get_fid_record_params(DPFJ_FID_FORMAT image_type, const unsigned char *image, DPFJ_FID_RECORD_PARAMS *params)
Read image properties from FID.
unsigned int quality
Definition: dpfj.h:625
unsigned int view_number
Definition: dpfj.h:657
struct dpfj_candidate DPFJ_CANDIDATE
Candidate, result of identification.
int DPAPICALL dpfj_create_fmd_from_fid(DPFJ_FID_FORMAT fid_type, const unsigned char *fid, unsigned int fid_size, DPFJ_FMD_FORMAT fmd_type, unsigned char *fmd, unsigned int *fmd_size)
Extracts features and creates an FMD from an ANSI or ISO image.
unsigned int finger_cnt
Definition: dpfj.h:606
Define FMD properties.
Definition: dpfj.h:638
Define fingerprint image view (FIV) properties.
Definition: dpfj.h:620
unsigned int fmd_idx
Definition: dpfj.h:235
struct dpfj_version DPFJ_VERSION
Complete information about library/SDK.
struct dpfj_fmd_view_params DPFJ_FMD_VIEW_PARAMS
Define fingerprint minutiae view (FMV) properties.
void DPAPICALL dpfj_set_fid_view_params(const DPFJ_FID_VIEW_PARAMS *params, unsigned char *view)
Write image view properties to FID.
void DPAPICALL dpfj_set_fmd_view_params(const DPFJ_FMD_VIEW_PARAMS *params, unsigned char *view)
Write view properties to FMD.
Define fingerprint minutiae view (FMV) properties.
Definition: dpfj.h:655
API Version information.
Definition: dpfj.h:215
int DPAPICALL dpfj_dp_fid_convert(const unsigned char *dp_image, unsigned int dp_image_size, DPFJ_FID_FORMAT fid_type, unsigned int fid_dpi, unsigned int rotate180, unsigned char *fid, unsigned int *fid_size)
Converts legacy DigitalPersona image to the image in ANSI or ISO format.
int DPAPICALL dpfj_fmd_convert(DPFJ_FMD_FORMAT fmd1_type, unsigned char *fmd1, unsigned int fmd1_size, DPFJ_FMD_FORMAT fmd2_type, unsigned char *fmd2, unsigned int *fmd2_size)
Converts an FMD from any supported format to any other supported format.
unsigned int view_idx
Definition: dpfj.h:236
DPFJ_VER_INFO api_ver
Definition: dpfj.h:227
unsigned int scale_units
Definition: dpfj.h:607
unsigned int capture_equipment_comp
Definition: dpfj.h:641
void DPAPICALL dpfj_set_fmd_record_params(const DPFJ_FMD_RECORD_PARAMS *params, DPFJ_FMD_FORMAT fmd_type, unsigned char *fmd)
Write minutiae record properties to FMD.
int DPAPICALL dpfj_create_enrollment_fmd(unsigned char *fmd, unsigned int *fmd_size)
Creates and returns enrollment FMD.
struct dpfj_fid_view_params DPFJ_FID_VIEW_PARAMS
Define fingerprint image view (FIV) properties.
int DPFJ_FINGER_POSITION
Defines finger position.
Definition: dpfj.h:152
DPFJ_FINGER_POSITION finger_position
Definition: dpfj.h:656
int DPAPICALL dpfj_create_fmd_from_raw(const unsigned char *image_data, unsigned int image_size, unsigned int image_width, unsigned int image_height, unsigned int image_dpi, DPFJ_FINGER_POSITION finger_pos, unsigned int cbeff_id, DPFJ_FMD_FORMAT fmd_type, unsigned char *fmd, unsigned int *fmd_size)
Extracts features and creates an FMD from a raw image.
struct dpfj_fid_record_params DPFJ_FID_RECORD_PARAMS
Define image properties.
unsigned int scan_res
Definition: dpfj.h:608
unsigned int record_length
Definition: dpfj.h:602
unsigned int size
Definition: dpfj.h:225
void DPAPICALL dpfj_get_fmd_view_params(const unsigned char *view, DPFJ_FMD_VIEW_PARAMS *params)
Read view properties from FMD.
unsigned int cbeff_id
Definition: dpfj.h:640
int DPFJ_FID_FORMAT
Fingerprint Image Data (FID) Format.
Definition: dpfj.h:131
int DPAPICALL dpfj_version(DPFJ_VERSION *ver)
Query the library and API version information.
unsigned int capture_equipment_id
Definition: dpfj.h:642
unsigned int size
Definition: dpfj.h:234
int DPAPICALL dpfj_add_to_enrollment(DPFJ_FMD_FORMAT fmd_type, unsigned char *fmd, unsigned int fmd_size, unsigned int fmd_view_idx)
Adds FMD to enrollment operation.
unsigned int width
Definition: dpfj.h:643
unsigned int ext_block_length
Definition: dpfj.h:661
unsigned int record_length
Definition: dpfj.h:639
void DPAPICALL dpfj_set_fid_record_params(const DPFJ_FID_RECORD_PARAMS *params, DPFJ_FID_FORMAT image_type, unsigned char *image)
Writes image properties to FID.
Complete information about library/SDK.
Definition: dpfj.h:224
unsigned int view_cnt
Definition: dpfj.h:646
unsigned int DPAPICALL dpfj_get_fmd_view_offset(DPFJ_FMD_FORMAT fmd_type, const unsigned char *fmd, unsigned int view_idx)
Return pointer to the specified view from FMD.
unsigned int height
Definition: dpfj.h:628
DPFJ_SCAN_TYPE impression_type
Definition: dpfj.h:658
int maintenance
Definition: dpfj.h:218
int DPFJ_SCAN_TYPE
Defines impression type.
Definition: dpfj.h:171
unsigned char * ext_block
Definition: dpfj.h:662
int DPAPICALL dpfj_start_enrollment(DPFJ_FMD_FORMAT fmd_type)
Starts enrollment operation.
unsigned int bpp
Definition: dpfj.h:610
unsigned int view_number
Definition: dpfj.h:624
void DPAPICALL dpfj_get_fid_view_params(const unsigned char *view, DPFJ_FID_VIEW_PARAMS *params)
Read image view properties from FID.
unsigned int width
Definition: dpfj.h:627
DPFJ_SCAN_TYPE impression_type
Definition: dpfj.h:626
int DPAPICALL dpfj_finish_enrollment()
Ends enrollment operation, releases memory.
unsigned int acquisition_level
Definition: dpfj.h:605
void * DPFJ_DEV
Reader handle.
Definition: dpfj.h:193
DPFJ_VER_INFO lib_ver
Definition: dpfj.h:226
int DPFJ_FMD_FORMAT
Fingerptint Minutiae Data (FMD) Format.
Definition: dpfj.h:139
unsigned int minutia_cnt
Definition: dpfj.h:660
unsigned int DPAPICALL dpfj_get_fid_view_offset(DPFJ_FID_FORMAT image_type, const unsigned char *image, unsigned int view_idx)
Returns pointer to the specified view from FID.
unsigned int height
Definition: dpfj.h:644
Candidate, result of identification.
Definition: dpfj.h:233
unsigned int compression
Definition: dpfj.h:611
int DPAPICALL dpfj_identify(DPFJ_FMD_FORMAT fmd1_type, unsigned char *fmd1, unsigned int fmd1_size, unsigned int fmd1_view_idx, DPFJ_FMD_FORMAT fmds_type, unsigned int fmds_cnt, unsigned char **fmds, unsigned int *fmds_size, unsigned int threshold_score, unsigned int *candidate_cnt, DPFJ_CANDIDATE *candidates)
Compares a single fingerprint to an array of fingerprints.
unsigned int capture_device_id
Definition: dpfj.h:604
int minor
Definition: dpfj.h:217
void DPAPICALL dpfj_get_fmd_record_params(DPFJ_FMD_FORMAT fmd_type, const unsigned char *fmd, DPFJ_FMD_RECORD_PARAMS *params)
Read minutiae record properties from FMD.
unsigned int quality
Definition: dpfj.h:659
unsigned int data_length
Definition: dpfj.h:621
unsigned int resolution
Definition: dpfj.h:645
int DPAPICALL dpfj_compare(DPFJ_FMD_FORMAT fmd1_type, unsigned char *fmd1, unsigned int fmd1_size, unsigned int fmd1_view_idx, DPFJ_FMD_FORMAT fmd2_type, unsigned char *fmd2, unsigned int fmd2_size, unsigned int fmd2_view_idx, unsigned int *score)
Compares two fingerprints.
struct dpfj_ver_info DPFJ_VER_INFO
API Version information.
unsigned int image_res
Definition: dpfj.h:609
int major
Definition: dpfj.h:216
unsigned char * view_data
Definition: dpfj.h:629
struct dpfj_fmd_record_params DPFJ_FMD_RECORD_PARAMS
Define FMD properties.
unsigned int cbeff_id
Definition: dpfj.h:603
DPFJ_FINGER_POSITION finger_position
Definition: dpfj.h:622
int DPAPICALL dpfj_select_engine(DPFJ_DEV hdev, DPFJ_ENGINE_TYPE engine)
Select matching engine.
int DPAPICALL dpfj_raw_convert(const unsigned char *image_data, unsigned int image_size, unsigned int image_width, unsigned int image_height, unsigned int image_dpi, DPFJ_FINGER_POSITION finger_pos, unsigned int cbeff_id, DPFJ_FID_FORMAT fid_type, unsigned int fid_dpi, unsigned int rotate180, unsigned char *fid, unsigned int *fid_size)
Converts raw image to the image in ANSI or ISO format.
unsigned int view_cnt
Definition: dpfj.h:623
Define image properties.
Definition: dpfj.h:601