wip: Search & replace RXingResultPoint with Point

Build fails because the OneDReader proc macro expects
that a RXingResultPoint type exists.
This commit is contained in:
Vukašin Stepanović
2023-02-16 08:25:32 +00:00
parent 15280d5f98
commit dbc6ca4e55
57 changed files with 476 additions and 476 deletions

View File

@@ -6,7 +6,7 @@ use crate::{
detector::MathUtils, BitMatrix, DefaultGridSampler, DetectorRXingResult, GridSampler,
Result,
},
Exceptions, RXingResultPoint,
Exceptions, Point,
};
use super::MaxiCodeReader;
@@ -16,7 +16,7 @@ const ROW_SCAN_SKIP: u32 = 2;
#[derive(Debug)]
pub struct MaxicodeDetectionResult {
bits: BitMatrix,
points: Vec<RXingResultPoint>,
points: Vec<Point>,
rotation: f32,
}
@@ -31,7 +31,7 @@ impl DetectorRXingResult for MaxicodeDetectionResult {
&self.bits
}
fn getPoints(&self) -> &[RXingResultPoint] {
fn getPoints(&self) -> &[Point] {
&self.points
}
}
@@ -387,7 +387,7 @@ pub fn detect(image: &BitMatrix, try_harder: bool) -> Result<MaxicodeDetectionRe
points: symbol_box
.0
.iter()
.map(|p| RXingResultPoint { x: p.0, y: p.1 })
.map(|p| Point { x: p.0, y: p.1 })
.collect(),
rotation: symbol_box.1,
});
@@ -717,10 +717,10 @@ fn box_symbol(image: &BitMatrix, circle: &mut Circle) -> Result<([(f32, f32); 4]
calculate_simple_boundary(circle, Some(image), None, false);
let naive_box = [
RXingResultPoint::new(left_boundary as f32, bottom_boundary as f32),
RXingResultPoint::new(left_boundary as f32, top_boundary as f32),
RXingResultPoint::new(right_boundary as f32, bottom_boundary as f32),
RXingResultPoint::new(right_boundary as f32, top_boundary as f32),
Point::new(left_boundary as f32, bottom_boundary as f32),
Point::new(left_boundary as f32, top_boundary as f32),
Point::new(right_boundary as f32, bottom_boundary as f32),
Point::new(right_boundary as f32, top_boundary as f32),
];
#[allow(unused_mut)]
@@ -807,9 +807,9 @@ const BOTTOM_RIGHT_ORIENTATION_POS: ((u32, u32), (u32, u32), (u32, u32)) =
fn attempt_rotation_box(
image: &BitMatrix,
circle: &mut Circle,
naive_box: &[RXingResultPoint; 4],
naive_box: &[Point; 4],
center_scale: f64,
) -> Option<([RXingResultPoint; 4], f32)> {
) -> Option<([Point; 4], f32)> {
// update our circle with a more accurate center point
circle.calculate_high_accuracy_center();
@@ -955,10 +955,10 @@ fn attempt_rotation_box(
Some((
[
RXingResultPoint::new(new_1.0, new_1.1),
RXingResultPoint::new(new_2.0, new_2.1),
RXingResultPoint::new(new_3.0, new_3.1),
RXingResultPoint::new(new_4.0, new_4.1),
Point::new(new_1.0, new_1.1),
Point::new(new_2.0, new_2.1),
Point::new(new_3.0, new_3.1),
Point::new(new_4.0, new_4.1),
],
final_rotation,
))