mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
Remove result_point_utils::distance()
This commit is contained in:
@@ -19,7 +19,8 @@ use std::cmp::Ordering;
|
||||
use crate::{
|
||||
common::{BitMatrix, Result},
|
||||
qrcode::detector::{FinderPattern, FinderPatternFinder, FinderPatternInfo},
|
||||
result_point_utils, DecodeHintType, DecodingHintDictionary, Exceptions, PointCallback,
|
||||
result_point_utils, DecodeHintType, DecodingHintDictionary, Exceptions, Point, PointCallback,
|
||||
ResultPoint,
|
||||
};
|
||||
|
||||
// max. legal count of modules per QR code edge (177)
|
||||
@@ -174,9 +175,18 @@ impl<'a> MultiFinderPatternFinder<'_> {
|
||||
|
||||
// Calculate the distances: a = topleft-bottomleft, b=topleft-topright, c = diagonal
|
||||
let info = FinderPatternInfo::new(test);
|
||||
let dA = result_point_utils::distance(info.getTopLeft(), info.getBottomLeft());
|
||||
let dC = result_point_utils::distance(info.getTopRight(), info.getBottomLeft());
|
||||
let dB = result_point_utils::distance(info.getTopLeft(), info.getTopRight());
|
||||
let dA = Point::distance(
|
||||
info.getTopLeft().to_rxing_result_point(),
|
||||
info.getBottomLeft().to_rxing_result_point(),
|
||||
);
|
||||
let dC = Point::distance(
|
||||
info.getTopRight().to_rxing_result_point(),
|
||||
info.getBottomLeft().to_rxing_result_point(),
|
||||
);
|
||||
let dB = Point::distance(
|
||||
info.getTopLeft().to_rxing_result_point(),
|
||||
info.getTopRight().to_rxing_result_point(),
|
||||
);
|
||||
|
||||
// Check the sizes
|
||||
let estimatedModuleCount = (dA + dB) / (p1.getEstimatedModuleSize() * 2.0);
|
||||
|
||||
Reference in New Issue
Block a user