mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-27 21:02:35 +00:00
does not build, mostly ported concentric_finder
This commit is contained in:
@@ -117,6 +117,22 @@ impl std::ops::Add for Point {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Add<f32> for Point {
|
||||
type Output = Self;
|
||||
|
||||
fn add(self, rhs: f32) -> Self::Output {
|
||||
Self::new(self.x + rhs, self.y + rhs)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Add<Point> for f32 {
|
||||
type Output = Point;
|
||||
|
||||
fn add(self, rhs: Point) -> Self::Output {
|
||||
Point::new(rhs.x + self, rhs.y + self)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Mul for Point {
|
||||
type Output = Self;
|
||||
|
||||
@@ -141,6 +157,14 @@ impl std::ops::Mul<i32> for Point {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Mul<u32> for Point {
|
||||
type Output = Self;
|
||||
|
||||
fn mul(self, rhs: u32) -> Self::Output {
|
||||
Self::new(self.x * rhs as f32, self.y * rhs as f32)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Mul<Point> for i32 {
|
||||
type Output = Point;
|
||||
|
||||
@@ -165,6 +189,14 @@ impl std::ops::Div<f32> for Point {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::ops::Mul<Point> for u32 {
|
||||
type Output = Point;
|
||||
|
||||
fn mul(self, rhs: Point) -> Self::Output {
|
||||
Self::Output::new(rhs.x * self as f32, rhs.y * self as f32)
|
||||
}
|
||||
}
|
||||
|
||||
impl Point {
|
||||
pub fn dot(self, p: Self) -> f32 {
|
||||
self.x * p.x + self.y * p.y
|
||||
|
||||
Reference in New Issue
Block a user