[−][src]Struct fprint_rs::Device
Methods
impl Device
[src]
pub fn new(device: *mut fp_dev) -> Self
[src]
pub fn get_driver(&self) -> Driver
[src]
Get the Driver
for a fingerprint device.
pub fn get_nr_enroll_stages(&self) -> i32
[src]
Gets the number of enroll stages required to enroll a fingerprint with the device.
pub fn get_enroll_stages_count(&self) -> i32
[src]
Alias for get_nr_enroll_stages
pub fn get_dev_type(&self) -> u32
[src]
Gets the devtype for a device.
pub fn supports_print_data(&self, data: &PrintData) -> bool
[src]
Determines if a stored print is compatible with a certain device.
pub fn is_support_print_data(&self, data: &PrintData) -> bool
[src]
pub fn supports_imaging(&self) -> bool
[src]
Determines if a device has imaging capabilities. If a device has imaging capabilities
you are able to perform imaging operations such as retrieving scan images using
img_capture
. However, not all devices are imaging devices – some do all processing
in hardware. This function will indicate which class a device in question falls into.
pub fn supports_identification(&self) -> bool
[src]
Determines if a device is capable of identification through identify_finger
and similar.
Not all devices support this functionality.
pub fn get_img_width(&self) -> SizeVariant
[src]
Gets the expected width of images that will be captured from the device. If the width of images from this device can vary, 0 will be returned.
pub fn get_img_height(&self) -> SizeVariant
[src]
Gets the expected height of images that will be captured from the device. If the height of images from this device can vary, 0 will be returned.
pub fn load_data(&self, finger: Finger) -> Result<PrintData>
[src]
Loads a previously stored print from disk. The print must have been saved earlier
using the PrintData::save_to_disk()
function
pub fn delete_data(&self, finger: Finger) -> Result<()>
[src]
Removes a stored print from disk previously saved with PrintData::save_to_disk()
.
pub fn capture_image(&self, unconditional: bool) -> Result<Image>
[src]
Captures a fp_img from a device. The returned image is the raw image provided by the device, you may wish to standardize it.
If set, the unconditional
flag indicates that the device should capture an image
unconditionally, regardless of whether a finger is there or not. If unset, this function
will block until a finger is detected on the sensor.
pub fn enroll_finger_image(&self, print: &mut PrintData) -> Result<EnrollResult>
[src]
Performs an enroll stage. See Enrolling for an explanation of enroll stages.
If no enrollment is in process, this kicks of the process and runs the first stage. If an enrollment is already in progress, calling this function runs the next stage, which may well be the last.
A negative error code may be returned from any stage. When this occurs, further calls to the enroll function will start a new enrollment process, i.e. a negative error code indicates that the enrollment process has been aborted. These error codes only ever indicate unexpected internal errors or I/O problems.
The EnrollResult::Retry
codes may be returned from any enroll stage. These codes
indicate that the scan was not succesful in that the user did not position their finger
correctly or similar. When a EnrollResult::Retry
code is returned, the enrollment stage
is not advanced, so the next call into this function will retry the current stage again.
The current stage may need to be retried several times.
The EnrollResult::Fail
code may be returned from any enroll stage. This code
indicates that even though the scans themselves have been acceptable, data processing
applied to these scans produces incomprehensible results. In other words, the user may
have been scanning a different finger for each stage or something like that. Like
negative error codes, this return code indicates that the enrollment process has been aborted.
The EnrollResult::Pass
code will only ever be returned for non-final stages.
This return code indicates that the scan was acceptable and the next call into this
function will advance onto the next enroll stage.
The EnrollResult::Complete
code will only ever be returned from the final enroll stage.
It indicates that enrollment completed successfully, and that print_data has been assigned
to point to the resultant enrollment data. The print_data parameter will not be modified
during any other enrollment stages, hence it is actually legal to pass NULL as this
argument for all but the final stage.
If the device is an imaging device, it can also return the image from the scan, even
when the enroll fails with a Retry
or Fail
code. It is legal to call this function
even on non-imaging devices, just don't expect them to provide images.
pub fn enroll<'a>(
&'a self
) -> impl Generator<Yield = EnrollResult, Return = Result<PrintData>> + 'a
[src]
&'a self
) -> impl Generator<Yield = EnrollResult, Return = Result<PrintData>> + 'a
Like an enroll_finger_image
but returns generator what yielded enroll result and
returns print data.
pub fn verify_finger_image(&self, print: &mut PrintData) -> Result<VerifyResult>
[src]
Performs a new scan and verify it against a previously enrolled print. If the device is an imaging device, it can also return the image from the scan, even when the verify fails with a RETRY code. It is legal to call this function even on non-imaging devices, just don't expect them to provide images.
pub fn identify_finger_image(
&self,
gallery: &mut PrintData,
offset: usize
) -> Result<VerifyResult>
[src]
&self,
gallery: &mut PrintData,
offset: usize
) -> Result<VerifyResult>
Performs a new scan and attempts to identify the scanned finger against a collection of previously enrolled fingerprints. If the device is an imaging device, it can also return the image from the scan, even when identification fails with a RETRY code. It is legal to call this function even on non-imaging devices, just don't expect them to provide images.
This function returns codes from VerifyResult
. The return code VerifyResult::Match
indicates that the scanned fingerprint does appear in the print gallery, and the
match_offset output parameter will indicate the index into the print gallery array of
the matched print.
This function will not necessarily examine the whole print gallery, it will return as soon as it finds a matching print.
Not all devices support identification. -ENOTSUP will be returned when this is the case.
Trait Implementations
impl Drop for Device
[src]
impl Clone for Device
[src]
fn clone(&self) -> Device
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Device
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,