Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libfprint
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
85
Issues
85
List
Boards
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
libfprint
libfprint
Commits
b9238e8b
Commit
b9238e8b
authored
Nov 08, 2007
by
Daniel Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support images with variable dimensions
For example, AES2501 returns images that vary in height.
parent
e1a25eeb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
14 deletions
+35
-14
examples/img_capture_continuous.c
examples/img_capture_continuous.c
+5
-0
libfprint/imgdev.c
libfprint/imgdev.c
+30
-14
No files found.
examples/img_capture_continuous.c
View file @
b9238e8b
...
...
@@ -176,6 +176,11 @@ int main(void)
img_width
=
fp_dev_get_img_width
(
dev
);
img_height
=
fp_dev_get_img_height
(
dev
);
if
(
img_width
<=
0
||
img_height
<=
0
)
{
fprintf
(
stderr
,
"this device returns images with variable dimensions,"
" this example does not support that.
\n
"
);
goto
out
;
}
framebuffer
=
malloc
(
img_width
*
img_height
*
2
);
if
(
!
framebuffer
)
goto
out
;
...
...
libfprint/imgdev.c
View file @
b9238e8b
...
...
@@ -73,13 +73,14 @@ int fpi_imgdev_get_img_height(struct fp_img_dev *imgdev)
}
int
fpi_imgdev_capture
(
struct
fp_img_dev
*
imgdev
,
int
unconditional
,
struct
fp_img
**
image
)
struct
fp_img
**
_img
)
{
struct
fp_driver
*
drv
=
imgdev
->
dev
->
drv
;
struct
fp_img_driver
*
imgdrv
=
fpi_driver_to_img_driver
(
drv
);
struct
fp_img
*
img
;
int
r
;
if
(
!
image
)
{
if
(
!
_img
)
{
fp_err
(
"no image pointer given"
);
return
-
EINVAL
;
}
...
...
@@ -107,35 +108,50 @@ int fpi_imgdev_capture(struct fp_img_dev *imgdev, int unconditional,
}
}
r
=
imgdrv
->
capture
(
imgdev
,
unconditional
,
image
);
r
=
imgdrv
->
capture
(
imgdev
,
unconditional
,
&
img
);
if
(
r
)
{
fp_err
(
"capture failed with error %d"
,
r
);
return
r
;
}
if
(
img
==
NULL
)
{
fp_err
(
"capture succeeded but no image returned?"
);
return
-
ENODATA
;
}
if
(
!
unconditional
&&
imgdrv
->
await_finger_off
)
{
r
=
imgdrv
->
await_finger_off
(
imgdev
);
if
(
r
)
{
fp_err
(
"await_finger_off failed with error %d"
,
r
);
fp_img_free
(
img
);
return
r
;
}
}
if
(
r
==
0
)
{
struct
fp_img
*
img
=
*
image
;
if
(
img
==
NULL
)
{
fp_err
(
"capture succeeded but no image returned?"
);
return
-
ENODATA
;
}
if
(
imgdrv
->
img_width
>
0
)
{
img
->
width
=
imgdrv
->
img_width
;
}
else
if
(
img
->
width
<=
0
)
{
fp_err
(
"no image width assigned"
);
goto
err
;
}
if
(
imgdrv
->
img_height
>
0
)
{
img
->
height
=
imgdrv
->
img_height
;
if
(
!
fpi_img_is_sane
(
img
))
{
fp_err
(
"image is not sane!"
);
return
-
EIO
;
}
}
else
if
(
img
->
height
<=
0
)
{
fp_err
(
"no image height assigned"
);
goto
err
;
}
return
r
;
if
(
!
fpi_img_is_sane
(
img
))
{
fp_err
(
"image is not sane!"
);
goto
err
;
}
*
_img
=
img
;
return
0
;
err:
fp_img_free
(
img
);
return
-
EIO
;
}
#define MIN_ACCEPTABLE_MINUTIAE 10
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment