add point(x: f32, y: f32) function

Shorter than writing `Point::new`
This commit is contained in:
Vukašin Stepanović
2023-02-16 11:20:03 +00:00
parent 868a9b26de
commit 39b4866e47
22 changed files with 113 additions and 109 deletions

View File

@@ -16,7 +16,7 @@
use std::hash::Hash;
use crate::Point;
use crate::{point, Point};
/**
* Encapsulates an RSS barcode finder pattern, including its start/end position and row.
@@ -34,8 +34,8 @@ impl FinderPattern {
value,
startEnd,
resultPoints: vec![
Point::new(start as f32, rowNumber as f32),
Point::new(end as f32, rowNumber as f32),
point(start as f32, rowNumber as f32),
point(end as f32, rowNumber as f32),
],
}
}

View File

@@ -19,7 +19,7 @@ use std::collections::HashMap;
use crate::{
common::{BitArray, Result},
oned::{one_d_reader, OneDReader},
BarcodeFormat, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions, Point,
point, BarcodeFormat, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions,
RXingResult, RXingResultMetadataType, RXingResultMetadataValue, Reader,
};
@@ -259,7 +259,7 @@ impl RSS14Reader {
// row is actually reversed
center = row.getSize() as f32 - 1.0 - center;
}
cb(&Point::new(center, rowNumber as f32));
cb(&point(center, rowNumber as f32));
}
let outside = self.decodeDataCharacter(row, &pattern, true)?;