remove ResultPoint trait uses of Point

Point already has `x` and `y` properties, so accessing
them with `getX()` and `getY()` is needlessly verbose.
These calls have been removed, though the trait impl is
still presen for the time being, since the OneDReader
proc macro requires it.
This commit is contained in:
Vukašin Stepanović
2023-02-16 15:54:07 +00:00
parent 9889555b02
commit 0992e85e6c
16 changed files with 137 additions and 147 deletions

View File

@@ -19,7 +19,7 @@
use crate::{
common::{BitMatrix, Result},
point, Exceptions, Point, ResultPoint,
point, Exceptions, Point,
};
/**
@@ -74,7 +74,7 @@ impl<'a> MonochromeRectangleDetector<'_> {
bottom,
halfWidth / 2,
)?;
top = (pointA.getY() - 1f32) as i32;
top = (pointA.y - 1f32) as i32;
let pointB = self.findCornerFromCenter(
halfWidth,
-deltaX,
@@ -86,7 +86,7 @@ impl<'a> MonochromeRectangleDetector<'_> {
bottom,
halfHeight / 2,
)?;
left = (pointB.getX() - 1f32) as i32;
left = (pointB.x - 1f32) as i32;
let pointC = self.findCornerFromCenter(
halfWidth,
deltaX,
@@ -98,7 +98,7 @@ impl<'a> MonochromeRectangleDetector<'_> {
bottom,
halfHeight / 2,
)?;
right = (pointC.getX() + 1f32) as i32;
right = (pointC.x + 1f32) as i32;
let pointD = self.findCornerFromCenter(
halfWidth,
0,
@@ -110,7 +110,7 @@ impl<'a> MonochromeRectangleDetector<'_> {
bottom,
halfWidth / 2,
)?;
bottom = (pointD.getY() + 1f32) as i32;
bottom = (pointD.y + 1f32) as i32;
// Go try to find point A again with better information -- might have been off at first.
pointA = self.findCornerFromCenter(

View File

@@ -18,7 +18,7 @@
use crate::{
common::{BitMatrix, Result},
point, Exceptions, Point, ResultPoint,
point, Exceptions, Point,
};
/**
@@ -326,14 +326,14 @@ impl<'a> WhiteRectangleDetector<'_> {
// y y
//
let yi = y.getX();
let yj = y.getY();
let zi = z.getX();
let zj = z.getY();
let xi = x.getX();
let xj = x.getY();
let ti = t.getX();
let tj = t.getY();
let yi = y.x;
let yj = y.y;
let zi = z.x;
let zj = z.y;
let xi = x.x;
let xj = x.y;
let ti = t.x;
let tj = t.y;
if yi < self.width as f32 / 2.0f32 {
[