Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////
- unit dpfpdd;
- {$mode objfpc}{$H+}
- interface
- uses
- ctypes;
- const
- {$ifdef MSWINDOWS}
- LIB_DPFPDD = 'dpfpdd.dll';
- {$else}
- LIB_DPFPDD = 'libdpfpdd.so';
- {$endif}
- {$MACRO ON}
- (**
- \file dpfpdd.pas
- \copyright (c) 2011 DigitalPersona, Inc.
- \brief U.are.U SDK DP Capture API
- Data types and functions to access fingerprint readers.
- \version 2.0.0
- *)
- (** \cond NEVER *)
- {$ifndef DPAPICALL}
- {$ifdef Win32}
- {$ifdef WinCE}
- {$define DPAPICALL := cdecl}
- {$else}
- {$define DPAPICALL := stdcall}
- {$endif}
- {$else}
- {$define DPAPICALL := cdecl}
- {$endif}
- {$endif}
- {$ifndef NULL}
- NULL = pointer(0);
- {$endif}
- (* api version 1.10 *)
- DPFPDD_API_VERSION_MAJOR = 1;
- DPFPDD_API_VERSION_MINOR = 10;
- (****************************************************************************************************
- Error codes
- ****************************************************************************************************)
- _DP_FACILITY = $05BA;
- (**
- \brief API call succeeded.
- *)
- DPFPDD_SUCCESS = 0;
- (**
- \brief API call is not implemented.
- *)
- DPFPDD_E_NOT_IMPLEMENTED = ($0a Or (_DP_FACILITY Shl 16));
- (**
- \brief Unspecified failure.
- "Catch-all" generic failure code. Can be returned by all API calls in case of failure, when the reason for the failure is unknown or cannot be specified.
- *)
- DPFPDD_E_FAILURE = ($0b Or (_DP_FACILITY Shl 16));
- (**
- \brief No data is available.
- *)
- DPFPDD_E_NO_DATA = ($0c Or (_DP_FACILITY Shl 16));
- (**
- \brief The memory allocated by the application is not big enough for the data which is expected.
- *)
- DPFPDD_E_MORE_DATA = ($0d Or (_DP_FACILITY Shl 16));
- (**
- \brief One or more parameters passed to the API call are invalid.
- *)
- DPFPDD_E_INVALID_PARAMETER = ($14 Or (_DP_FACILITY Shl 16));
- (**
- \brief Reader handle is not valid.
- *)
- DPFPDD_E_INVALID_DEVICE = ($15 Or (_DP_FACILITY Shl 16));
- (**
- \brief The API call cannot be completed because another call is in progress.
- *)
- DPFPDD_E_DEVICE_BUSY = ($1e Or (_DP_FACILITY Shl 16));
- (**
- \brief The reader is not working properly.
- *)
- DPFPDD_E_DEVICE_FAILURE = ($1f Or (_DP_FACILITY Shl 16));
- (****************************************************************************************************
- Data types and structures
- ****************************************************************************************************)
- (**
- \brief Reader handle.
- Calling dpfpdd_open() connects to a device and returns a handle.
- Open handles must be released when no longer needed by calling dpfpdd_close().
- *)
- type
- PDPFPDD_DEV = pointer;
- (**
- \brief API version information.
- *)
- TDPFPDD_VER_INFO = record
- major : cint; (**< major version number *)
- minor : cint; (**< minor version number *)
- maintenance: cint; (**< maintenance or revision number *)
- end;
- (**
- \brief Complete information about library/SDK.
- *)
- PDPFPDD_VERSION = ^TDPFPDD_VERSION;
- TDPFPDD_VERSION = record
- size : cuint; (**< size of the structure, in bytes *)
- lib_ver : TDPFPDD_VER_INFO; (**< file version of the SDK/library *)
- api_ver : TDPFPDD_VER_INFO; (**< version of the API *)
- end;
- (**
- \brief Reader modality.
- *)
- TDPFPDD_HW_MODALITY = cuint;
- const
- DPFPDD_HW_MODALITY_UNKNOWN = 0; (**< modality is not known *)
- DPFPDD_HW_MODALITY_SWIPE = 1; (**< swipe reader *)
- DPFPDD_HW_MODALITY_AREA = 2; (**< area or placement reader *)
- (**
- \brief Reader technology.
- *)
- type
- TDPFPDD_HW_TECHNOLOGY = cuint;
- const
- DP_HW_TECHNOLOGY_UNKNOWN = 0; (**< technology is not known *)
- DP_HW_TECHNOLOGY_OPTICAL = 1; (**< optical reader *)
- DP_HW_TECHNOLOGY_CAPACITIVE = 2; (**< capacitive reader *)
- DP_HW_TECHNOLOGY_THERMAL = 3; (**< thermal reader *)
- DP_HW_TECHNOLOGY_PRESSURE = 4; (**< pressure reader *)
- (**
- \brief Maximum length of the strings in the descriptors, in bytes.
- *)
- MAX_STR_LENGTH = 128;
- (**
- \brief Maximum length of the reader name.
- *)
- MAX_DEVICE_NAME_LENGTH = 1024;
- (**
- \brief Reader hardware descriptor.
- *)
- type
- TDPFPDD_HW_DESCR = record
- vendor_name : array[0..(MAX_STR_LENGTH-1)] of cchar;(**< name of the vendor *)
- product_name: array[0..(MAX_STR_LENGTH-1)] of cchar;(**< name of the product *)
- serial_num : array[0..(MAX_STR_LENGTH-1)] of cchar; (**< serial number *)
- end;
- (**
- \brief Reader Hardware ID.
- *)
- TDPFPDD_HW_ID = record
- vendor_id : cushort; (**< vendor ID (USB VID) *)
- product_id: cushort; (**< product ID (USB PID) *)
- end;
- (**
- \brief Reader hardware version.
- *)
- TDPFPDD_HW_VERSION = record
- hw_ver : TDPFPDD_VER_INFO; (**< hardware version *)
- fw_ver : TDPFPDD_VER_INFO; (**< firmware version *)
- bcd_rev: cushort; (**< USB bcd revision *)
- end;
- (**
- \brief Complete information about reader hardware.
- *)
- PDPFPDD_DEV_INFO = ^TDPFPDD_DEV_INFO;
- TDPFPDD_DEV_INFO = record
- size : cuint; (**< size of the structure *)
- name : array[0..(MAX_DEVICE_NAME_LENGTH-1)] of cchar;(**< unique name of the reader *)
- descr : TDPFPDD_HW_DESCR; (**< displayable information about reader *)
- id : TDPFPDD_HW_ID; (**< USB ID *)
- ver : TDPFPDD_HW_VERSION; (**< reader hardware version information *)
- modality : TDPFPDD_HW_MODALITY; (**< reader modality *)
- technology : TDPFPDD_HW_TECHNOLOGY; (**< reader technology *)
- end;
- (**
- \brief Constants describing priority of the client opening the reader (Windows-only)
- *)
- TDPFPDD_PRIORITY = cuint;
- const
- DPFPDD_PRIORITY_COOPERATIVE = 2; (**< Client uses this priority to open reader in cooperative mode. Multiple clients with this priority are allowed. Client receives captured images if it has window with focus. *)
- DPFPDD_PRIORITY_EXCLUSIVE = 4; (**< Client uses this priority to open reader exclusively. Only one client with this priority is allowed. *)
- (**
- \brief Information about reader capabilities.
- *)
- type
- PDPFPDD_DEV_CAPS = ^TDPFPDD_DEV_CAPS;
- TDPFPDD_DEV_CAPS = record
- size : cuint; (**< size of the structure *)
- can_capture_image : cint; (**< flag: reader can capture images *)
- can_stream_image : cint; (**< flag: reader can stream images *)
- can_extract_features: cint; (**< flag: reader can extract features from captured image and return fingerprint features data *)
- can_match : cint; (**< flag: reader can perform match one-to-one *)
- can_identify : cint; (**< flag: reader can perform match one-to-many *)
- has_fp_storage : cint; (**< flag: reader has storage for fingerprint features data *)
- indicator_type : cuint; (**< bitmask: existing LEDs and supported LED modes (see DPFPDD_CLIENT_XXX_SUPPORTED)*)
- has_pwr_mgmt : cint; (**< flag: power mode of the reader can be controlled *)
- has_calibration : cint; (**< flag: reader can be calibrated *)
- piv_compliant : cint; (**< flag: can produce PIV compliant images *)
- resolution_cnt : cuint; (**< counter: number of the image resolutions reader can produce *)
- resolutions : array[0..0] of cuint; (**< array: available resolutions *)
- end;
- (**
- \brief Constants describing status of the reader
- *)
- TDPFPDD_STATUS = cuint;
- const
- DPFPDD_STATUS_READY = 0; (**< ready for capture *)
- DPFPDD_STATUS_BUSY = 1; (**< cannot capture, another operation is in progress *)
- DPFPDD_STATUS_NEED_CALIBRATION = 2; (**< ready for capture, but calibration needs to be performed soon *)
- DPFPDD_STATUS_FAILURE = 3; (**< cannot capture, reset is needed *)
- (**
- \brief Describes status of the reader
- *)
- type
- PDPFPDD_DEV_STATUS = ^TDPFPDD_DEV_STATUS;
- TDPFPDD_DEV_STATUS = record
- size : cuint; (**< total size of the allocated memory including size of additional data *)
- status : TDPFPDD_STATUS; (**< reader status *)
- finger_detected : cint; (**< flag: finger detected on the reader *)
- data : array[0..0] of cuchar;(**< additional vendor-specific data which may be passed by the driver *)
- end;
- (**
- \brief Result of the capture operation
- *)
- TDPFPDD_QUALITY = cuint;
- const
- DPFPDD_QUALITY_GOOD = 0; (**< capture succeeded *)
- DPFPDD_QUALITY_TIMED_OUT = 1; (**< timeout expired *)
- DPFPDD_QUALITY_CANCELED = (1 Shl 1); (**< capture was canceled *)
- DPFPDD_QUALITY_NO_FINGER = (1 Shl 2); (**< non-finger detected *)
- DPFPDD_QUALITY_FAKE_FINGER = (1 Shl 3); (**< fake finger detected *)
- DPFPDD_QUALITY_FINGER_TOO_LEFT = (1 Shl 4); (**< finger is too far left on the reader *)
- DPFPDD_QUALITY_FINGER_TOO_RIGHT = (1 Shl 5); (**< finger is too far right on the reader *)
- DPFPDD_QUALITY_FINGER_TOO_HIGH = (1 Shl 6); (**< finger is too high on the reader *)
- DPFPDD_QUALITY_FINGER_TOO_LOW = (1 Shl 7); (**< finger is too low in the reader *)
- DPFPDD_QUALITY_FINGER_OFF_CENTER = (1 Shl 8); (**< finger is not centered on the reader *)
- DPFPDD_QUALITY_SCAN_SKEWED = (1 Shl 9); (**< scan is skewed too much *)
- DPFPDD_QUALITY_SCAN_TOO_SHORT = (1 Shl 10); (**< scan is too short *)
- DPFPDD_QUALITY_SCAN_TOO_LONG = (1 Shl 11); (**< scan is too long *)
- DPFPDD_QUALITY_SCAN_TOO_SLOW = (1 Shl 12); (**< speed of the swipe is too slow *)
- DPFPDD_QUALITY_SCAN_TOO_FAST = (1 Shl 13); (**< speed of the swipe is too fast *)
- DPFPDD_QUALITY_SCAN_WRONG_DIRECTION = (1 Shl 14); (**< direction of the swipe is wrong *)
- DPFPDD_QUALITY_READER_DIRTY = (1 Shl 15); (**< reader needs cleaning *)
- (**
- \brief Format of captured fingerprint image.
- *)
- type
- TDPFPDD_IMAGE_FMT = cuint;
- const
- DPFPDD_IMG_FMT_PIXEL_BUFFER = 0; (**< "raw" format, pixel buffer without a header *)
- DPFPDD_IMG_FMT_ANSI381 = $001B0401; (**< ANSI INSITS 381-2004 format *)
- DPFPDD_IMG_FMT_ISOIEC19794 = $01010007; (**< ISO IEC 19794-4-2005 format *)
- (**
- \brief Image processing.
- *)
- type
- TDPFPDD_IMAGE_PROC = cuint;
- const
- DPFPDD_IMG_PROC_DEFAULT = 0; (**< Recommended processing. This is to acquire image as fast as possible. The image is suitable for feature extraction. *)
- DPFPDD_IMG_PROC_PIV = 1; (**< To request image which will be PIV compliant. Not every reader supports this mode. The image is suitable for feature extraction. *)
- DPFPDD_IMG_PROC_ENHANCED = 2; (**< To request visually enhanced image. The image is suitable for feature extraction. *)
- DPFPDD_IMG_PROC_ENHANCED_2 = 3; (**< To request visually enhanced image. The image is suitable for feature extraction. *)
- DPFPDD_IMG_PROC_UNPROCESSED = $52617749; (**< To request image which is not processed in any way. The image is NOT suitable for feature extraction. *)
- DPFPDD_IMG_PROC_NONE = DPFPDD_IMG_PROC_DEFAULT deprecated; (**< for backward compatibility *)
- (**
- \brief Describes image parameters for capture
- *)
- type
- PDPFPDD_CAPTURE_PARAM = ^TDPFPDD_CAPTURE_PARAM;
- TDPFPDD_CAPTURE_PARAM = record
- size : cuint; (**< size of the structure *)
- image_fmt : TDPFPDD_IMAGE_FMT; (**< format of the image *)
- image_proc : TDPFPDD_IMAGE_PROC; (**< processing of the image *)
- image_res : cuint; (**< resolution of the image *)
- end;
- (**
- \brief Describes captured image
- The output parameter of the dpfpdd_capture() and dpfpdd_get_stream_image() functions.
- *)
- TDPFPDD_IMAGE_INFO = record
- size : cuint; (**< size of the structure *)
- width : cuint; (**< width of the captured image *)
- height: cuint; (**< height of the captured image *)
- res : cuint; (**< resolution of the captured image *)
- bpp : cuint; (**< pixel depth of the captured image *)
- end;
- (**
- \brief Describes the result of the capture operation
- *)
- PDPFPDD_CAPTURE_RESULT = ^TDPFPDD_CAPTURE_RESULT;
- TDPFPDD_CAPTURE_RESULT = record
- size : cuint; (**< size of the structure *)
- success : cint; (**< success flag; 0: capture failed, 1: capture succeeded, image is good *)
- quality : TDPFPDD_QUALITY; (**< image quality *)
- score : cuint; (**< image score *)
- info : TDPFPDD_IMAGE_INFO; (**< image info *)
- end;
- (**
- \brief Describes the result of asynchronous capture operation
- *)
- TDPFPDD_CAPTURE_CALLBACK_DATA_0 = record
- size : cuint; (**< size of the structure *)
- error : cint; (**< error code *)
- capture_parm : TDPFPDD_CAPTURE_PARAM; (**< capture parameters passed to dpfpdd_capture_async *)
- capture_result : TDPFPDD_CAPTURE_RESULT; (**< result of the capture operation *)
- image_size : cint; (**< size of the image data *)
- image_data : pcuchar; (**< image data *)
- end;
- (**
- \brief Callback for asynchronous capture
- *)
- DPFPDD_CAPTURE_CALLBACK = function(
- callback_context : pointer; (**< client context *)
- reserved, (**< currently reserved, always 0 *)
- callback_data_size : cuint; (**< size of the callback data *)
- callback_data : pointer (**< callback data (currently DPFPDD_CAPTURE_CALLBACK_DATA_0) *)
- ): pointer; DPAPICALL;
- (**
- \brief LED identifiers
- *)
- TDPFPDD_LED_ID = cuint;
- const
- DPFPDD_LED_MAIN = $01; (**< main (illumination) LED *)
- DPFPDD_LED_REJECT = $04; (**< red (reject) LED *)
- DPFPDD_LED_ACCEPT = $08; (**< green (accept) LED *)
- DPFPDD_LED_FINGER_DETECT= $10; (**< blue (finger detect) LED *)
- DPFPDD_LED_AUX_1 = $14; (**< auxiliary LED *)
- DPFPDD_LED_AUX_2 = $18; (**< auxiliary LED *)
- DPFPDD_LED_PWM = $80; (**< main LED on PWM mode *)
- DPFPDD_LED_ALL = $ffffffff; (**< all present LEDs *)
- (**
- \brief LED operation mode
- *)
- type
- TDPFPDD_LED_MODE_TYPE = cuint;
- const
- DPFPDD_LED_AUTO = 1; (**< automatic, default configuration *)
- DPFPDD_LED_CLIENT = 2; (**< client application controls LED, simple ON/OFF *)
- DPFPDD_LED_CLIENT_PWM = 3; (**< client application controls LED with dimming *)
- DPFPDD_LED_CLIENT_BLINK = 4; (**< client application controls LED, blinking *)
- (**
- \brief LED state commands
- *)
- type
- TDPFPDD_LED_CMD_TYPE = cuint;
- //For DPFPDD_LED_CLIENT mode
- const
- DPFPDD_LED_CMD_OFF = 0; (**< turn LED off *)
- DPFPDD_LED_CMD_ON = 1; (**< turn LED on *)
- //For DPFPDD_LED_CLIENT_PWM mode use values between these constants (included)
- //The LED controller will use nearest supported value
- DPFPDD_LED_CMD_PWM_MIN = 0; (**< turn LED off *)
- DPFPDD_LED_CMD_PWM_MAX = 255; (**< turn LED on, full bright*)
- //For DPFPDD_LED_CLIENT_BLINK mode the DPFPDD_LED_CMD_TYPE parameter specifies period in milliseconds
- //The LED controller will use nearest supported value
- //DPFPDD_DEV_CAPS.indicator_type contains mask of existing LEDs and supported LED modes
- //DPFPDD_LED_AUTO and DPFPDD_LED_CLIENT is always supported
- DPFPDD_CLIENT_PWM_SUPPORTED = $80000000; (**< LED control with dimming is supported (DPFPDD_LED_CLIENT_PWM)*)
- DPFPDD_CLIENT_BLINK_SUPPORTED = $40000000; (**< LED control with blinking is supported (DPFPDD_LED_CLIENT_BLINK )*)
- (**
- \brief Reader and driver settings
- *)
- type
- TDPFPDD_PARMID = cuint;
- const
- DPFPDD_PARMID_ROTATE = $100; (**< rotate image 180 degrees *)
- DPFPDD_PARMID_FINGERDETECT_ENABLE = $104; (**< enable detection of fingers *)
- DPFPDD_PARMID_IOMAP = $105; (**< I/O map settings *)
- (**
- \brief I/O map setting parameters.
- *)
- type
- TDPFPDD_IOMAP = record
- addr: cushort; (**< I/O address or offset *)
- len : cushort; (**< size size of the data buffer *)
- buff: array[0..0] of cuchar;(**< data buffer *)
- end;
- (****************************************************************************************************
- API calls
- ****************************************************************************************************)
- (**
- \brief Queries the library and API version information.
- This is the only function which can be called before dpfpdd_init() or after dpfpdd_exit().
- \param ver [in] Pointer to memory buffer; [out] Pointer to the version information (per DPFPDD_VERSION)
- \return DPFPDD_SUCCESS: Version information was acquired;
- \return DPFPDD_E_FAILURE: Failed to acquire version information.
- *)
- function dpfpdd_version(
- ver: PDPFPDD_VERSION
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Library initialization.
- This function initializes the library. It must be called before calling any other functions from the library, except dpfpdd_version().
- \return DPFPDD_SUCCESS: Library was initialized;
- \return DPFPDD_E_FAILURE: Failed to initialize library.
- *)
- function dpfpdd_init(): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Library release.
- This function releases the library. After calling this function the application can only call dpfpdd_version(), and dpfpdd_init().
- \return DPFPDD_SUCCESS: Library was released;
- \return DPFPDD_E_FAILURE: Failed to release library.
- *)
- function dpfpdd_exit(): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Returns information about connected readers.
- Client application must allocate memory for the list of the available devices and pass number of entries in the dev_cnt parameter.
- If memory is not sufficient to contain information about all connected readers, then DPFPDD_E_MORE_DATA will be returned.
- The number of connected devices will be returned in dev_cnt parameter.
- \param dev_cnt [in] Number of entries in the dev_infos memory block; [out] Number of devices detected
- \param dev_infos [in] Memory block; [out] Information about connected readers (per DPFPDD_DEV_INFO)
- \return DPFPDD_SUCCESS: Information about connected readers obtained;
- \return DPFPDD_E_FAILURE: Unexpected failure;
- \return DPFPDD_E_MORE_DATA: Insufficient memory in dev_infos memory block for all readers. No data was returned. The required number of entries is in the dev_cnt.
- *)
- function dpfpdd_query_devices(
- dev_cnt : pcuint;
- dev_infos: PDPFPDD_DEV_INFO
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Opens a fingerprint reader in exclusive mode.
- If you or another process have already opened the reader, you cannot open it again.
- \param dev_name Name of the reader, as acquired from dpfpdd_query_devices().
- \param pdev [in] Pointer to empty handle (per DPFPDD_DEV); [out] Pointer to reader handle.
- \return DPFPDD_SUCCESS: A valid reader handle is in the ppdev;
- \return DPFPDD_E_FAILURE: Unexpected failure;
- \return DPFPDD_E_INVALID_PARAMETER: No reader with this name found;
- \return DPFPDD_E_DEVICE_BUSY: Reader is already opened by the same or another process;
- \return DPFPDD_E_DEVICE_FAILURE: Failed to open the reader.
- *)
- function dpfpdd_open(
- dev_name: pcchar;
- pdev : PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Opens a fingerprint reader.
- On Windows, client can choose if to open reader exclusively or in cooperative mode. In cooperative mode the process which has window in focus
- will receive captured image.
- On Linux and Windows CE functionality is identical to dpfpdd_open. Priority is ignored and reader is always opened in exclusive mode.
- \param dev_name Name of the reader, as acquired from dpfpdd_query_devices().
- \param priority Priority of the client.
- \param pdev [in] Pointer to empty handle (per DPFPDD_DEV); [out] Pointer to reader handle.
- \return DPFPDD_SUCCESS: A valid reader handle is in the ppdev;
- \return DPFPDD_E_FAILURE: Unexpected failure;
- \return DPFPDD_E_INVALID_PARAMETER: No reader with this name found;
- \return DPFPDD_E_DEVICE_BUSY: Reader is already opened by the same or another process;
- \return DPFPDD_E_DEVICE_FAILURE: Failed to open the reader.
- *)
- function dpfpdd_open_ext(
- dev_name: pcchar;
- priority: TDPFPDD_PRIORITY;
- pdev : PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Releases the reader.
- \param dev Reader handle, as obtained from dpfpdd_open()
- \return DPFPDD_SUCCESS: Reader closed, handle released
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_DEVICE_FAILURE: Failed to close the reader
- *)
- function dpfpdd_close(
- dev: PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Returns status of the reader.
- \param dev Reader handle, as obtained from dpfpdd_open()
- \param dev_status [in] Pointer to empty status (per DPFPDD_DEV_STATUS); [out] Pointer to status of the reader
- \return DPFPDD_SUCCESS: Reader status obtained
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the dev_status, the required size is in the dev_status.size
- *)
- function dpfpdd_get_device_status(
- dev : PDPFPDD_DEV;
- dev_status : PDPFPDD_DEV_STATUS
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Queries hardware info and capabilities of the reader.
- Client application must allocate memory for the information about the reader. If the allocated memory is not sufficient to hold
- information about all resolutions, then DPFPDD_E_MORE_DATA will be returned.
- The number of resolutions will be returned in the dev_caps.resolution_cnt field, and the required size of
- the .dev_caps will be returned in the dev_caps.size field.
- \param dev Reader handle, as obtained from dpfpdd_open();
- \param dev_caps [in] Pointer empty info structure (per DPFPDD_DEV_CAPS); [out] Pointer to reader capabilities.
- \return DPFPDD_SUCCESS: Reader capabilities obtained
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the dev_caps, the required size is in the dev_caps.size
- \return DPFPDD_E_DEVICE_FAILURE: Failed to obtain capabilities, reader is not functioning properly
- *)
- function dpfpdd_get_device_capabilities(
- dev : PDPFPDD_DEV;
- dev_caps : PDPFPDD_DEV_CAPS
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Capture a fingerprint image.
- This function captures a fingerprint image from the opened reader device.
- This function signals the device that a fingerprint is expected and waits until a fingerprint is received.
- This function blocks until an image is captured, capture fails or timeout is expired. This function cannot
- be called in streaming mode. Client application must allocate memory for the image_data. If memory
- is not sufficient for the image, then DPFPDD_E_MORE_DATA will be returned. The required size of the
- image_data will be returned in image_size parameter.
- \param dev Reader handle, as obtained from dpfpdd_open()
- \param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
- \param timeout_cnt Defines timeout in milliseconds; (unsigned int)(-1) means no timeout (function will block until a fingerprint is captured)
- \param capture_result [in] Pointer to memory buffer; [out] Pointer to status of results (per DPFPDD_CAPTURE_RESULT)
- \param image_size [in] Size of the allocated memory for the image_data; [out] Actual size needed for the image_data
- \param image_data [in] Memory buffer; [out] Captured image
- \return DPFPDD_SUCCESS: Image captured. Extended result is in capture_result
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the image_data, the required size is in the image_size
- \return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
- \return DPFPDD_E_DEVICE_FAILURE: Failed to start capture, reader is not functioning properly
- *)
- function dpfpdd_capture(
- dev : PDPFPDD_DEV;
- capture_parm : PDPFPDD_CAPTURE_PARAM;
- timeout_cnt : cuint;
- capture_result: PDPFPDD_CAPTURE_RESULT;
- image_size : pcuint;
- image_data : pcuchar
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Capture a fingerprint image asynchronously.
- This function starts asynchronous capture on the opened reader device.
- This function signals the device that a fingerprint is expected and then exits.
- \param dev Reader handle, as obtained from dpfpdd_open()
- \param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
- \param context Client context, passed into the callback
- \param callback Address of the callback function, to be called when image is ready
- \return DPFPDD_SUCCESS: Image captured. Extended result is in capture_result
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
- \return DPFPDD_E_DEVICE_FAILURE: Failed to start capture, reader is not functioning properly
- *)
- function dpfpdd_capture_async(
- dev : PDPFPDD_DEV;
- capture_parm : PDPFPDD_CAPTURE_PARAM;
- context : pointer;
- callback : DPFPDD_CAPTURE_CALLBACK
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Cancels pending capture.
- \param dev Reader handle, as obtained from dpfpdd_open();
- \return DPFPDD_SUCCESS: Capture canceled
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_FAILURE: Failed to cancel capture, reader is not functioning properly
- *)
- function dpfpdd_cancel(
- dev: PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Puts reader into streaming mode.
- Not all readers support this mode. When the reader is in streaming mode, the application can only call
- dpfpdd_get_stream_image() to acquire images from the stream.
- \param dev Reader handle, as obtained from dpfpdd_open()
- \return DPFPDD_SUCCESS: Reader put into streaming mode
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_DEVICE_FAILURE: Failed to start streaming, reader is not functioning properly
- *)
- function dpfpdd_start_stream(
- dev: PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Stops streaming mode.
- \param dev Reader handle, obtained from dpfpdd_open()
- \return DPFPDD_SUCCESS: Streaming was stopped
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_FAILURE: Failed to stop streaming, reader is not functioning properly
- *)
- function dpfpdd_stop_stream(
- dev: PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Takes an image from the stream.
- After the reader is put into streaming mode this function takes an image from the stream. After this function returns, the
- reader stays in the streaming mode. Frame selection, scoring or other image processing is not performed.
- The client application must allocate memory for the image_data. If the memory is not sufficient for the image, then
- DPFPDD_E_MORE_DATA will be returned. The required size of the image_data will be returned in the image_size parameter.
- For every image from the stream, the driver provides a score (in capture_result.score) and quality feedback (in capture_result.quailty).
- \param dev Reader handle, obtained from dpfpdd_open()
- \param capture_parm Defines data type and image format (per DPFPDD_CAPTURE_PARAM)
- \param capture_result Pointer to the structure to receive result of the capture (per DPFPDD_CAPTURE_RESULT)
- \param image_size [in] Size of the allocated memory for the image_data; [out] Actual size needed for the image_data
- \param image_data Receives captured image
- \return DPFPDD_SUCCESS: Image acquired from the stream. Extended result is in capture_result
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_MORE_DATA: Insufficient memory is allocated for the image_data, the required size is in the image_size
- \return DPFPDD_E_INVALID_PARAMETER: Wrong data type or image format in the capture_parm
- \return DPFPDD_E_DEVICE_FAILURE: Failed to acquire image from the stream, reader is not functioning properly
- *)
- function dpfpdd_get_stream_image (
- dev : PDPFPDD_DEV;
- capture_parm : PDPFPDD_CAPTURE_PARAM;
- capture_result : PDPFPDD_CAPTURE_RESULT;
- image_size : pcuint;
- image_data : pcuchar
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Resets the reader.
- This function performs a hardware reset on the reader. Hardware resets are typically needed only
- after a hardware problem (e.g., the reader is unplugged or receives an electrostatic shock).
- This function blocks until the reset is complete.
- \param dev Reader handle, as obtained from dpfpdd_open();
- \return DPFPDD_SUCCESS: Reset succeeded;
- \return DPFPDD_E_FAILURE: Unexpected failure;
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle;
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress;
- \return DPFPDD_E_DEVICE_FAILURE: Failed to reset, reader is not functioning properly.
- *)
- function dpfpdd_reset(
- dev: PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Calibrates the reader.
- This function calibrates a reader and blocks until the calibration is complete. It can take several seconds to calibrate for some devices.
- \param dev Reader handle, as obtained from dpfpdd_open();
- \return DPFPDD_SUCCESS: Calibration succeeded
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_DEVICE_FAILURE: Failed to calibrate, reader is not functioning properly
- *)
- function dpfpdd_calibrate(
- dev: PDPFPDD_DEV
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Sets configuration parameters for LED.
- Function sets operation mode for LED: automatic or controlled by client application.
- \param dev Reader handle, as obtained from dpfpdd_open().
- \param led_id LED type.
- \param led_mode LED operation mode.
- \param reserved Reserved for future use, must be NULL.
- *)
- function dpfpdd_led_config(
- dev : PDPFPDD_DEV;
- led_id : TDPFPDD_LED_ID;
- led_mode : TDPFPDD_LED_MODE_TYPE;
- reserved : pointer
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Turns LED on/off or starts LED event
- If LED is controlled by client application this function allows to turn LED on or off.
- LED must be configured by calling dpfpdd_led_config().
- \param dev Reader handle, as obtained from dpfpdd_open().
- \param led_id LED type.
- \param led_cmd LED command.
- *)
- function dpfpdd_led_ctrl(
- dev : PDPFPDD_DEV;
- led_id : TDPFPDD_LED_ID;
- led_cmd: TDPFPDD_LED_CMD_TYPE
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (**
- \brief Changes reader or driver setting.
- \param dev Reader handle, as obtained from dpfpdd_open();
- \param parm_id Parameter ID;
- \param size Size of the parameter buffer;
- \param buffer Parameter buffer;
- \return DPFPDD_SUCCESS: Parameter was set
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_INVALID_PARAMETER: Parameter ID is incorrect or not supported
- \return DPFPDD_E_DEVICE_FAILURE: Failed to set parameter, reader is not functioning properly
- *)
- function dpfpdd_set_parameter(
- dev : PDPFPDD_DEV;
- parm_id : TDPFPDD_PARMID;
- size : cuint;
- buffer : pcuchar
- ): cint; DPAPICALL; external LIB_DPFPDD;
- (** \brief Reads reader or driver setting.
- \param dev Reader handle, obtained from dpfpdd_open();
- \param parm_id Parameter ID;
- \param size Size of the parameter buffer;
- \param buffer Parameter buffer;
- \return DPFPDD_SUCCESS: Parameter was set
- \return DPFPDD_E_FAILURE: Unexpected failure
- \return DPFPDD_E_INVALID_DEVICE: Invalid reader handle
- \return DPFPDD_E_DEVICE_BUSY: Another operation is in progress
- \return DPFPDD_E_INVALID_PARAMETER: Parameter ID is incorrect or not supported
- \return DPFPDD_E_DEVICE_FAILURE: Failed to set parameter, reader is not functioning properly
- *)
- function dpfpdd_get_parameter(
- dev : PDPFPDD_DEV;
- parm_id : TDPFPDD_PARMID;
- size : cuint;
- buffer : pcuchar
- ): cint; DPAPICALL; external LIB_DPFPDD;
- implementation
- end.
- /////////////////////////////////
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement