mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
slight performance improvement, detector
This commit is contained in:
@@ -29,10 +29,10 @@ use super::MultiFinderPatternFinder;
|
||||
* @author Sean Owen
|
||||
* @author Hannes Erven
|
||||
*/
|
||||
pub struct MultiDetector(Detector);
|
||||
impl MultiDetector {
|
||||
pub fn new(image: BitMatrix) -> Self {
|
||||
Self(Detector::new(image))
|
||||
pub struct MultiDetector<'a>(Detector<'a>);
|
||||
impl<'a> MultiDetector<'_> {
|
||||
pub fn new(image: &'a BitMatrix) -> MultiDetector<'a> {
|
||||
MultiDetector(Detector::new(image))
|
||||
}
|
||||
|
||||
// private static final DetectorRXingResult[] EMPTY_DETECTOR_RESULTS = new DetectorRXingResult[0];
|
||||
|
||||
@@ -50,7 +50,7 @@ impl MultipleBarcodeReader for QRCodeMultiReader {
|
||||
) -> Result<Vec<crate::RXingResult>, crate::Exceptions> {
|
||||
let mut results = Vec::new();
|
||||
let detectorRXingResults =
|
||||
MultiDetector::new(image.getBlackMatrix().clone()).detectMulti(hints)?;
|
||||
MultiDetector::new(image.getBlackMatrix()).detectMulti(hints)?;
|
||||
for detectorRXingResult in detectorRXingResults {
|
||||
let mut proc = || -> Result<(), Exceptions> {
|
||||
let decoderRXingResult = decoder::decoder::decode_bitmatrix_with_hints(
|
||||
|
||||
Reference in New Issue
Block a user