mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
remove impl ResultPoint for FinderPattern & AlignmentPattern
This commit is contained in:
@@ -182,10 +182,23 @@ impl Point {
|
||||
f32::max(self.x.abs(), self.y.abs())
|
||||
}
|
||||
|
||||
pub fn squaredDistance(self, p: Self) -> f32 {
|
||||
let diff = self - p;
|
||||
diff.x * diff.x + diff.y * diff.y
|
||||
}
|
||||
|
||||
pub fn distance(self, p: Self) -> f32 {
|
||||
(self - p).length()
|
||||
}
|
||||
|
||||
pub fn abs(self) -> Self {
|
||||
Self::new(self.x.abs(), self.y.abs())
|
||||
}
|
||||
|
||||
pub fn fold<U, F: Fn(f32, f32) -> U>(self, f: F) -> U {
|
||||
f(self.x, self.y)
|
||||
}
|
||||
|
||||
/// Calculate a floating point pixel coordinate representing the 'center' of the pixel.
|
||||
/// This is sort of the inverse operation of the PointI(PointF) conversion constructor.
|
||||
/// See also the documentation of the GridSampler API.
|
||||
|
||||
Reference in New Issue
Block a user