in_progress port from cpp

This commit is contained in:
Henry Schimke
2023-03-18 15:48:47 -05:00
parent 07b934283b
commit 4c8db1f73f
9 changed files with 544 additions and 5 deletions

View File

@@ -25,6 +25,14 @@ pub fn point(x: f32, y: f32) -> Point {
Point::new(x, y)
}
pub fn point_g<T: TryInto<f32>>(x: T, y: T) -> Option<Point> {
Some(Point::new(x.try_into().ok()?, y.try_into().ok()?))
}
pub fn point_i(x: u32, y: u32) -> Point {
Point::new(x as f32, y as f32)
}
/** Currently necessary because the external OneDReader proc macro uses it. */
pub type RXingResultPoint = Point;