## Internal FpPrint Internal FpPrint — Internal fingerprint handling routines |

## Functions

void | fpi_print_add_print ()
void | fpi_print_set_type ()
void | fpi_print_set_device_stored ()
gboolean | fpi_print_add_from_image ()
FpiMatchResult | fpi_print_bz3_match ()
gchar * | fpi_print_generate_user_id ()
gboolean | fpi_print_fill_from_user_id ()

## Types and Values

enum | FpiPrintType
enum | FpiMatchResult

## Description

Interaction with prints and their storage. See also the public FpPrint routines.

## Functions

### fpi_print_add_print ()

    void
    fpi_print_add_print (FpPrint *print,
                         FpPrint *add);

Appends the single FPI_PRINT_NBIS print from `add` to the collection of prints in `print` . Both print objects need to be of type FPI_PRINT_NBIS for this to work.

#### Parameters

print | A FpPrint |
add | Print to append to `print` |

### fpi_print_set_type ()

    void
    fpi_print_set_type (FpPrint *print,
                        FpiPrintType type);

This function can only be called exactly once. Drivers should call it after creating a new print, or to initialize the template print passed during enrollment.

#### Parameters

print | A FpPrint |
type | The newly type of the print data |

### fpi_print_set_device_stored ()

    void
    fpi_print_set_device_stored (FpPrint *print,
                                 gboolean device_stored);

Drivers must set this to `TRUE` for any print that is really a handle for data that is stored on the device itself.

#### Parameters

print | A FpPrint |
device_stored | Whether the print is stored on the device or not |

### fpi_print_add_from_image ()

    gboolean
    fpi_print_add_from_image (FpPrint *print,
                              FpImage *image,
                              GError **error);

Extracts the minutiae from the given image and adds it to `print` of type FPI_PRINT_NBIS.

The `image` will be kept so that API users can get retrieve it e.g. for debugging purposes.

#### Parameters

print | A FpPrint |
image | A FpImage |
error | Return location for error |

#### Returns

`TRUE` on success

### fpi_print_bz3_match ()

    FpiMatchResult
    fpi_print_bz3_match (FpPrint *print_template,
                         FpPrint *print,
                         gint bz3_threshold,
                         GError **error);

Match the newly scanned `print` (containing exactly one print) against the prints contained in `template` which will have been stored during enrollment.

Both `template` and `print` need to be of type FPI_PRINT_NBIS for this to work.

#### Parameters

print_template | A FpPrint containing one or more prints |
print | A newly scanned FpPrint to test |
bz3_threshold | The BZ3 match threshold |
error | Return location for error |

#### Returns

Whether the prints match, `error` will be set if FPI_MATCH_ERROR is returned

### fpi_print_generate_user_id ()

    gchar *
    fpi_print_generate_user_id (FpPrint *print);

Generates a string identifier for the represented print. This identifier encodes some metadata about the print. It also includes a random string and may be assumed to be unique.

This is useful if devices are able to store a string identifier, but more storing more metadata may be desirable. In effect, this means the driver can provide somewhat more meaningful data to `fp_device_list_prints()`.

The generated ID may be truncated after 23 characters. However, more space is required to include the username, and it is recommended to store at at least 31 bytes.

The generated format may change in the future. It is versioned though and decoding should remain functional.

#### Parameters

print | FpPrint to generate the ID for |

#### Returns

A unique string of 23 + strlen(username) characters

### fpi_print_fill_from_user_id ()

    gboolean
    fpi_print_fill_from_user_id (FpPrint *print,
                                 const char *user_id);

This is the reverse operation of `fpi_print_generate_user_id()`, allowing the driver to encode some print metadata in a string.

#### Parameters

print | FpPrint to fill metadata into |
user_id | An ID that was likely encoded using `fpi_print_generate_user_id()` |

#### Returns

Whether a valid ID was found

## Types and Values

### enum FpiPrintType

#### Members

FPI_PRINT_UNDEFINED | Undefined type, this happens prior to enrollment |
FPI_PRINT_RAW | A raw print where the data is directly compared |
FPI_PRINT_NBIS | NBIS minutiae comparison |

### enum FpiMatchResult

#### Members

FPI_MATCH_ERROR | An error occurred during matching |
FPI_MATCH_FAIL | The prints did not match |
FPI_MATCH_SUCCESS | The prints matched |