mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
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:
@@ -17,7 +17,7 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use crate::common::Result;
|
||||
use crate::{point, Exceptions, Point, RXingResult, Reader, ResultPoint};
|
||||
use crate::{point, Exceptions, Point, RXingResult, Reader};
|
||||
|
||||
/**
|
||||
* This class attempts to decode a barcode from an image, not by scanning the whole image,
|
||||
@@ -133,7 +133,7 @@ impl<T: Reader> ByQuadrantReader<T> {
|
||||
// result
|
||||
points
|
||||
.iter()
|
||||
.map(|relative| point(relative.getX() + leftOffset, relative.getY() + topOffset))
|
||||
.map(|relative| point(relative.x + leftOffset, relative.y + topOffset))
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ use std::collections::HashMap;
|
||||
|
||||
use crate::{
|
||||
common::Result, point, BinaryBitmap, DecodingHintDictionary, Exceptions, Point, RXingResult,
|
||||
Reader, ResultPoint,
|
||||
Reader,
|
||||
};
|
||||
|
||||
use super::MultipleBarcodeReader;
|
||||
@@ -115,8 +115,8 @@ impl<T: Reader> GenericMultipleBarcodeReader<T> {
|
||||
// if (point == null) {
|
||||
// continue;
|
||||
// }
|
||||
let x = point.getX();
|
||||
let y = point.getY();
|
||||
let x = point.x;
|
||||
let y = point.y;
|
||||
if x < minX {
|
||||
minX = x;
|
||||
}
|
||||
@@ -185,12 +185,7 @@ impl<T: Reader> GenericMultipleBarcodeReader<T> {
|
||||
|
||||
let newPoints: Vec<Point> = oldPoints
|
||||
.iter()
|
||||
.map(|oldPoint| {
|
||||
point(
|
||||
oldPoint.getX() + xOffset as f32,
|
||||
oldPoint.getY() + yOffset as f32,
|
||||
)
|
||||
})
|
||||
.map(|oldPoint| point(oldPoint.x + xOffset as f32, oldPoint.y + yOffset as f32))
|
||||
.collect();
|
||||
|
||||
// let mut newPoints = Vec::with_capacity(oldPoints.len());
|
||||
|
||||
Reference in New Issue
Block a user