remove MathUtils::round()

This commit is contained in:
Vukašin Stepanović
2023-02-16 09:37:21 +00:00
parent 79d9b28d19
commit 71128a81bc
4 changed files with 35 additions and 65 deletions

View File

@@ -17,10 +17,7 @@
use std::collections::HashMap;
use crate::{
common::{
detector::MathUtils, BitMatrix, DefaultGridSampler, GridSampler, PerspectiveTransform,
Result,
},
common::{BitMatrix, DefaultGridSampler, GridSampler, PerspectiveTransform, Result},
qrcode::decoder::Version,
result_point_utils, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions, Point,
PointCallback, ResultPoint,
@@ -235,9 +232,9 @@ impl<'a> Detector<'_> {
moduleSize: f32,
) -> Result<u32> {
let tltrCentersDimension =
MathUtils::round(result_point_utils::distance(topLeft, topRight) / moduleSize);
(result_point_utils::distance(topLeft, topRight) / moduleSize).round() as i32;
let tlblCentersDimension =
MathUtils::round(result_point_utils::distance(topLeft, bottomLeft) / moduleSize);
(result_point_utils::distance(topLeft, bottomLeft) / moduleSize).round() as i32;
let mut dimension = ((tltrCentersDimension + tlblCentersDimension) / 2) + 7;
match dimension & 0x03 {
0 => dimension += 1,