FpPrint: libfprint Reference Manual

## FpPrint FpPrint — Fingerprint handling |

## Functions

FpPrint * | fp_print_new ()
FpPrint * | fp_print_new_from_data ()
gboolean | fp_print_to_data ()
const gchar * | fp_print_get_driver ()
const gchar * | fp_print_get_device_id ()
gboolean | fp_print_get_device_stored ()
FpImage * | fp_print_get_image ()
FpFinger | fp_print_get_finger ()
const gchar * | fp_print_get_username ()
const gchar * | fp_print_get_description ()
const GDate * | fp_print_get_enroll_date ()
void | fp_print_set_finger ()
void | fp_print_set_username ()
void | fp_print_set_description ()
void | fp_print_set_enroll_date ()
gboolean | fp_print_compatible ()
gboolean | fp_print_equal ()
gboolean | fp_print_serialize ()
FpPrint * | fp_print_deserialize ()

## Types and Values

#define | FP_TYPE_PRINT
enum | FpFinger
| FpPrint

## Description

Interaction with prints and their storage.

## Functions

### fp_print_new ()

    FpPrint *
    fp_print_new (FpDevice *device);

Create a new FpPrint. This is only useful to prepare an enrollment of a new print using `fp_device_enroll()`. For this you should first create a new print, fill in the relevant metadata, and then start enrollment.

#### Parameters

device | A FpDevice |

#### Returns

A newyl created FpPrint.

[transfer floating]

### fp_print_new_from_data ()

    FpPrint *
    fp_print_new_from_data (guchar *data,
                            gsize length);

### fp_print_to_data ()

    gboolean
    fp_print_to_data (guchar **data,
                      gsize length);

### fp_print_get_driver ()

    const gchar *
    fp_print_get_driver (FpPrint *print);

Returns the driver that the print was created for.

#### Parameters

print | A FpPrint |

#### Returns

The driver.

[transfer none]

### fp_print_get_device_id ()

    const gchar *
    fp_print_get_device_id (FpPrint *print);

Returns the device ID that the print was created for.

#### Parameters

print | A FpPrint |

#### Returns

The device ID.

[transfer none]

### fp_print_get_device_stored ()

    gboolean
    fp_print_get_device_stored (FpPrint *print);

Whether the print is actually stored on the device and this is just a handle to use that references the device stored data.

#### Parameters

print | A FpPrint |

#### Returns

Whether the print is stored on the device

### fp_print_get_image ()

    FpImage *
    fp_print_get_image (FpPrint *print);

Returns the image that the print was created from, or `NULL`

#### Parameters

print | A FpPrint |

#### Returns

The FpImage.

[transfer none][nullable]

### fp_print_get_finger ()

    FpFinger
    fp_print_get_finger (FpPrint *print);

Returns the finger that the print was created for.

#### Parameters

print | A FpPrint |

#### Returns

The FpFinger

### fp_print_get_username ()

    const gchar *
    fp_print_get_username (FpPrint *print);

Returns the user defined username for the print.

#### Parameters

print | A FpPrint |

#### Returns

The username.

[transfer none][nullable]

### fp_print_get_description ()

    const gchar *
    fp_print_get_description (FpPrint *print);

Returns the user defined description for the print.

#### Parameters

print | A FpPrint |

#### Returns

The description.

[transfer none][nullable]

### fp_print_get_enroll_date ()

    const GDate *
    fp_print_get_enroll_date (FpPrint *print);

Returns the user defined enroll date for the print.

#### Parameters

print | A FpPrint |

#### Returns

The GDate.

[transfer none][nullable]

### fp_print_set_finger ()

    void
    fp_print_set_finger (FpPrint *print,
                         FpFinger finger);

Set the finger that the print is for.

#### Parameters

print | A FpPrint |
finger | The FpFinger |

### fp_print_set_username ()

    void
    fp_print_set_username (FpPrint *print,
                           const gchar *username);

Set the username for the print.

#### Parameters

print | A FpPrint |
username | The new username. | [transfer none]

### fp_print_set_description ()

    void
    fp_print_set_description (FpPrint *print,
                              const gchar *description);

Set the description for the print.

#### Parameters

print | A FpPrint |
description | The new description. | [transfer none]

### fp_print_set_enroll_date ()

    void
    fp_print_set_enroll_date (FpPrint *print,
                              const GDate *enroll_date);

Set the enroll date for the print.

#### Parameters

print | A FpPrint |
enroll_date | The new enroll date. | [transfer none]

### fp_print_compatible ()

    gboolean
    fp_print_compatible (FpPrint *self,
                         FpDevice *device);

Tests whether the prints is compatible with the given device.

#### Parameters

self | A FpPrint |
device | A FpDevice |

#### Returns

`TRUE` if the print is compatible with the device

### fp_print_equal ()

    gboolean
    fp_print_equal (FpPrint *self,
                    FpPrint *other);

Tests whether the prints can be considered equal. This only compares the actual information about the print, not the metadata.

#### Parameters

self | First FpPrint |
other | Second FpPrint |

#### Returns

`TRUE` if the prints are equal

### fp_print_serialize ()

    gboolean
    fp_print_serialize (FpPrint *print,
                        guchar **data,
                        gsize *length,
                        GError **error);

Serialize a print definition for permanent storage. Note that this is lossy in the sense that e.g. the image data is discarded.

#### Parameters

print | A FpPrint |
data | Return location for data pointer. | [array length=length][transfer full][out]
length | Length of `data` . | [transfer full][out]
error | Return location for error |

#### Returns

`TRUE` on success.

[type void]

### fp_print_deserialize ()

    FpPrint *
    fp_print_deserialize (const guchar *data,
                          gsize length,
                          GError **error);

Deserialize a print definition from permanent storage.

#### Parameters

data | The binary data. | [array length=length]
length | Length of the data |
error | Return location for error |

#### Returns

A newly created FpPrint on success.

[transfer full]

## Types and Values

### FP_TYPE_PRINT

    #define FP_TYPE_PRINT (fp_print_get_type ())

### enum FpFinger

#### Members

FP_FINGER_UNKNOWN | The finger is unknown |
FP_FINGER_LEFT_THUMB | Left thumb |
FP_FINGER_LEFT_INDEX | Left index finger |
FP_FINGER_LEFT_MIDDLE | Left middle finger |
FP_FINGER_LEFT_RING | Left ring finger |
FP_FINGER_LEFT_LITTLE | Left little finger |
FP_FINGER_RIGHT_THUMB | Right thumb |
FP_FINGER_RIGHT_INDEX | Right index finger |
FP_FINGER_RIGHT_MIDDLE | Right middle finger |
FP_FINGER_RIGHT_RING | Right ring finger |
FP_FINGER_RIGHT_LITTLE | Right little finger |
FP_FINGER_FIRST | The first finger in the fp-print order |
FP_FINGER_LAST | The last finger in the fp-print order |

### FpPrint

    typedef struct {
      GInitiallyUnowned parent_instance;

      FpiPrintType      type;

      gchar            *driver;
      gchar            *device_id;
      gboolean          device_stored;

      FpImage          *image;

      /* Metadata */
      FpFinger   finger;
      gchar     *username;
      gchar     *description;
      GDate     *enroll_date;

      GVariant  *data;
      GPtrArray *prints;
    } FpPrint;