mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
move to OnceCell binarizer cache
This commit is contained in:
@@ -41,9 +41,9 @@ pub fn detect_in_file_with_hints(
|
||||
.or_insert(DecodeHintValue::TryHarder(true));
|
||||
|
||||
multi_format_reader.decode_with_hints(
|
||||
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
|
||||
&mut BinaryBitmap::new(Rc::new(HybridBinarizer::new(Box::new(
|
||||
BufferedImageLuminanceSource::new(img),
|
||||
))))),
|
||||
)))),
|
||||
hints,
|
||||
)
|
||||
}
|
||||
@@ -67,9 +67,9 @@ pub fn detect_multiple_in_file_with_hints(
|
||||
.or_insert(DecodeHintValue::TryHarder(true));
|
||||
|
||||
scanner.decode_multiple_with_hints(
|
||||
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
|
||||
&mut BinaryBitmap::new(Rc::new(HybridBinarizer::new(Box::new(
|
||||
BufferedImageLuminanceSource::new(img),
|
||||
))))),
|
||||
)))),
|
||||
hints,
|
||||
)
|
||||
}
|
||||
@@ -104,9 +104,9 @@ pub fn detect_in_luma_with_hints(
|
||||
.or_insert(DecodeHintValue::TryHarder(true));
|
||||
|
||||
multi_format_reader.decode_with_hints(
|
||||
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
|
||||
&mut BinaryBitmap::new(Rc::new(HybridBinarizer::new(Box::new(
|
||||
Luma8LuminanceSource::new(luma, width, height),
|
||||
))))),
|
||||
)))),
|
||||
hints,
|
||||
)
|
||||
}
|
||||
@@ -133,9 +133,9 @@ pub fn detect_multiple_in_luma_with_hints(
|
||||
.or_insert(DecodeHintValue::TryHarder(true));
|
||||
|
||||
scanner.decode_multiple_with_hints(
|
||||
&mut BinaryBitmap::new(Rc::new(RefCell::new(HybridBinarizer::new(Box::new(
|
||||
&mut BinaryBitmap::new(Rc::new(HybridBinarizer::new(Box::new(
|
||||
Luma8LuminanceSource::new(luma, width, height),
|
||||
))))),
|
||||
)))),
|
||||
hints,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user