|
libfprint
|
Stored prints are represented by a structure named fp_print_data.
More...
Enumerations | |
| enum | fp_finger { LEFT_THUMB = 1, LEFT_INDEX, LEFT_MIDDLE, LEFT_RING, LEFT_LITTLE, RIGHT_THUMB, RIGHT_INDEX, RIGHT_MIDDLE, RIGHT_RING, RIGHT_LITTLE } |
| Numeric codes used to refer to fingers (and thumbs) of a human. More... | |
Functions | |
| size_t | fp_print_data_get_data (struct fp_print_data *data, unsigned char **ret) |
| Convert a stored print into a unified representation inside a data buffer. More... | |
| struct fp_print_data * | fp_print_data_from_data (unsigned char *buf, size_t buflen) |
| Load a stored print from a data buffer. More... | |
| int | fp_print_data_save (struct fp_print_data *data, enum fp_finger finger) |
| Saves a stored print to disk, assigned to a specific finger. More... | |
| int | fp_print_data_load (struct fp_dev *dev, enum fp_finger finger, struct fp_print_data **data) |
| Loads a previously stored print from disk. More... | |
| int | fp_print_data_delete (struct fp_dev *dev, enum fp_finger finger) |
| Removes a stored print from disk previously saved with fp_print_data_save(). More... | |
| int | fp_print_data_from_dscv_print (struct fp_dscv_print *print, struct fp_print_data **data) |
| Attempts to load a stored print based on a discovered print record. More... | |
| void | fp_print_data_free (struct fp_print_data *data) |
| Frees a stored print. More... | |
| uint16_t | fp_print_data_get_driver_id (struct fp_print_data *data) |
| Gets the driver ID for a stored print. More... | |
| uint32_t | fp_print_data_get_devtype (struct fp_print_data *data) |
| Gets the devtype for a stored print. More... | |
Stored prints are represented by a structure named fp_print_data.
Stored prints are originally obtained from an enrollment function such as fp_enroll_finger().
This page documents the various operations you can do with a stored print. Note that by default, "stored prints" are not actually stored anywhere except in RAM. For the simple scenarios, libfprint provides a simple API for you to save and load the stored prints referring to a single user in their home directory. For more advanced users, libfprint provides APIs for you to convert print data to a byte string, and to reconstruct stored prints from such data at a later point. You are welcome to store these byte strings in any fashion that suits you.
| enum fp_finger |
Numeric codes used to refer to fingers (and thumbs) of a human.
These are purposely not available as strings, to avoid getting the library tangled up in localization efforts.
| size_t fp_print_data_get_data | ( | struct fp_print_data * | data, |
| unsigned char ** | ret | ||
| ) |
Convert a stored print into a unified representation inside a data buffer.
You can then store this data buffer in any way that suits you, and load it back at some later time using fp_print_data_from_data().
| data | the stored print |
| ret | output location for the data buffer. Must be freed with free() after use. |
Referenced by fp_print_data_save().
| struct fp_print_data* fp_print_data_from_data | ( | unsigned char * | buf, |
| size_t | buflen | ||
| ) |
Load a stored print from a data buffer.
The contents of said buffer must be the untouched contents of a buffer previously supplied to you by the fp_print_data_get_data() function.
| buf | the data buffer |
| buflen | the length of the buffer |
| int fp_print_data_save | ( | struct fp_print_data * | data, |
| enum fp_finger | finger | ||
| ) |
Saves a stored print to disk, assigned to a specific finger.
Even though you are limited to storing only the 10 human fingers, this is a per-device-type limit. For example, you can store the users right index finger from a DigitalPersona scanner, and you can also save the right index finger from a UPEK scanner. When you later come to load the print, the right one will be automatically selected.
This function will unconditionally overwrite a fingerprint previously saved for the same finger and device type. The print is saved in a hidden directory beneath the current user's home directory.
| data | the stored print to save to disk |
| finger | the finger that this print corresponds to |
References fp_print_data_get_data().
| int fp_print_data_load | ( | struct fp_dev * | dev, |
| enum fp_finger | finger, | ||
| struct fp_print_data ** | data | ||
| ) |
Loads a previously stored print from disk.
The print must have been saved earlier using the fp_print_data_save() function.
A return code of -ENOENT indicates that the fingerprint requested could not be found. Other error codes (both positive and negative) are possible for obscure error conditions (e.g. corruption).
| dev | the device you are loading the print for |
| finger | the finger of the file you are loading |
| data | output location to put the corresponding stored print. Must be freed with fp_print_data_free() after use. |
References fp_dev_supports_print_data(), and fp_print_data_free().
| int fp_print_data_delete | ( | struct fp_dev * | dev, |
| enum fp_finger | finger | ||
| ) |
Removes a stored print from disk previously saved with fp_print_data_save().
| dev | the device that the print belongs to |
| finger | the finger of the file you are deleting |
| int fp_print_data_from_dscv_print | ( | struct fp_dscv_print * | print, |
| struct fp_print_data ** | data | ||
| ) |
Attempts to load a stored print based on a discovered print record.
A return code of -ENOENT indicates that the file referred to by the discovered print could not be found. Other error codes (both positive and negative) are possible for obscure error conditions (e.g. corruption).
| the discovered print | |
| data | output location to point to the corresponding stored print. Must be freed with fp_print_data_free() after use. |
| void fp_print_data_free | ( | struct fp_print_data * | data | ) |
Frees a stored print.
Must be called when you are finished using the print.
| data | the stored print to destroy. If NULL, function simply returns. |
Referenced by fp_print_data_load().
| uint16_t fp_print_data_get_driver_id | ( | struct fp_print_data * | data | ) |
Gets the driver ID for a stored print.
The driver ID indicates which driver the print originally came from. The print is only usable with a device controlled by that driver.
| data | the stored print |
| uint32_t fp_print_data_get_devtype | ( | struct fp_print_data * | data | ) |
Gets the devtype for a stored print.
The devtype represents which type of device under the parent driver is compatible with the print.
| data | the stored print |
1.8.8