slight performance improvement, detector

This commit is contained in:
Henry Schimke
2022-12-31 17:01:10 -06:00
parent a111776032
commit a6727220fa
11 changed files with 31 additions and 30 deletions

View File

@@ -42,8 +42,8 @@ const EXPECTED_CORNER_BITS: [u32; 4] = [
* @author David Olivier
* @author Frank Yellin
*/
pub struct Detector {
image: BitMatrix,
pub struct Detector<'a> {
image: &'a BitMatrix,
compact: bool,
nb_layers: u32,
@@ -52,9 +52,9 @@ pub struct Detector {
shift: u32,
}
impl Detector {
pub fn new(image: BitMatrix) -> Self {
Self {
impl<'a> Detector<'_> {
pub fn new(image: &'a BitMatrix) -> Detector<'a> {
Detector {
image,
compact: false,
nb_layers: 0,