Commit graph

17 commits

Author SHA1 Message Date
Benjamin Berg 51cab75b1e assembling: Fix copying only partial tile on overhang
If the tile in question was hanging over the left edge we would not be
copying the full available width. Fix this and change the test to catch
the error condition (by forcing a too small image and overlap both
ways).

Simplify the code by only selecting the starting point inside the
image/frame and then just checking the both image and frame boundary in
the loop. Not quite as efficient, but it really shouldn't matter too
much here.
2021-06-23 22:33:07 +02:00
Benjamin Berg 0d604fa34e fpi-assembling: Fix offsets to be relative to the previous frame
The offset stored for a frame was not always relative to the previous
frame. This was the case for reverse movement, but for forwrad movement
the offset was the one to the next frame.

Make the offset handling consistent and alwasy store the offset to the
previous frame. Also update the frame assembling code to add the offset
before blitting the frame (i.e. making it relative to the previous frame
there too).

Note that fpi_assemble_lines already made the assumption that this was
the case as it forced the offset for the first frame to be zero. As
such, the code was inconsistent.

This could affect the AES drivers slightly as they use hardware reported
values which might not adhere to these assumptions.
2020-01-02 13:46:46 +01:00
Benjamin Berg d9bcf9b9cc fpi-assembling: Accept error of zero
Rather than discarding a zero error, check that the constraints are
sane. This way a perfect match is possible.
2020-01-02 13:46:46 +01:00
Marco Trevisan (Treviño) 10945f8546 cleanup: Remove fp_internal.h and update drivers_api.h
Remove the uneeded internal API, as we can now include each header directly
if needed, while move the assembling stuff to the drivers API.
2019-12-17 14:38:19 +01:00
Benjamin Berg 8cc0fd321f assembling: Use fixed point for image assembly
Using floating point causes architecture dependent results due to
accuracy/rounding differences. It is not hard to switch to fixed point,
and while this does cause quite different rounding errors, the
difference is small.

Fixes: #200
2019-11-28 20:41:45 +00:00
Marco Trevisan (Treviño) f2b932960e lib: Use g_new0 rather than g_malloc0
Port some of the g_malloc0 users to g_new0.
2019-11-20 20:38:06 +01:00
Benjamin Berg 65e602d8c7 log: Re-indent fpi-log using uncrustify 2019-11-20 13:53:45 +01:00
Bastien Nocera f25d0a0dc9 lib: Remove num_stripes from fpi_assemble_frames() 2019-11-20 13:53:45 +01:00
Bastien Nocera 3b480caab1 lib: Remove num_stripes from fpi_do_movement_estimation() 2019-11-20 13:53:45 +01:00
Bastien Nocera dcc04089d1 lib: Remove num_stripes from movement_estimation()
fpi_do_movement_estimation is always called with num_stripes set to the
length of the list. Rather than using the passed value, assume we should
consume all stripes from the list.

Closes: #132
2019-11-20 13:53:45 +01:00
Benjamin Berg 689aff0232 lib: Major rewrite of the libfprint core and API
This is a rewrite of the core based on GObject and Gio. This commit
breaks the build in a lot of ways, but basic functionality will start
working again with the next commits.
2019-11-20 11:03:09 +01:00
Bastien Nocera 658c301e3c lib: Use memmove(), g_memmove() is deprecated 2019-08-05 18:12:06 +00:00
Bastien Nocera 3cbc908a6e lib: Add better guard against huge malloc
See dda6857fee
and https://bugzilla.redhat.com/show_bug.cgi?id=1656518

When the number of lines to assemble is 1, the median_filter() function
would be passed -1 as its size as it was calculated with:
(num_lines / 2) - 1
so (1 / 2) - 1 = 0 - 1 = -1

Add a guard to stop drivers trying to assemble single lines. This
doesn't however fix the vfs5011 driver that tried to do that.
2018-12-06 10:58:35 +01:00
Vasily Khoruzhick 2088a6177f lib: Document assembling functions 2018-12-03 16:06:53 +01:00
Bastien Nocera 511e164f17 lib: Add @short_description for all the sections
So gtk-doc doesn't warn about them any more.
2018-11-25 12:42:11 +00:00
Bastien Nocera 6c6daaa619 doc: Add fpi-assembling section to the docs 2018-11-09 14:08:04 +01:00
Bastien Nocera 1d93b86569 lib: Rename assembling.[ch]
This is already self-contained.
2018-09-28 15:12:39 +02:00
Renamed from libfprint/assembling.c (Browse further)