mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
remove indirection for RxingResultPoint
Previously, the struct was passed around everywhere as a reference. It only holds two floats, so there's no real need for indirection. Now it's being passed as a value.
This commit is contained in:
@@ -212,7 +212,7 @@ impl BitMatrix {
|
||||
((self.bits[offset] >> (x & 0x1f)) & 1) != 0
|
||||
}
|
||||
|
||||
pub fn get_point(&self, point: &RXingResultPoint) -> bool {
|
||||
pub fn get_point(&self, point: RXingResultPoint) -> bool {
|
||||
self.get(point.x as u32, point.y as u32)
|
||||
// let offset = self.get_offset(point.y as u32, point.x as u32);
|
||||
// ((self.bits[offset] >> (x & 0x1f)) & 1) != 0
|
||||
@@ -700,7 +700,7 @@ impl BitMatrix {
|
||||
new_bm
|
||||
}
|
||||
|
||||
pub fn isIn(&self, p: &RXingResultPoint, b: i32) -> bool {
|
||||
pub fn isIn(&self, p: RXingResultPoint, b: i32) -> bool {
|
||||
b as f32 <= p.x
|
||||
&& p.x < self.getWidth() as f32 - b as f32
|
||||
&& b as f32 <= p.y
|
||||
|
||||
@@ -280,7 +280,7 @@ impl<'a> WhiteRectangleDetector<'_> {
|
||||
return Err(Exceptions::NotFoundException(None));
|
||||
}
|
||||
|
||||
Ok(self.center_edges(&y.unwrap(), &z.unwrap(), &x.unwrap(), &t.unwrap()))
|
||||
Ok(self.center_edges(y.unwrap(), z.unwrap(), x.unwrap(), t.unwrap()))
|
||||
} else {
|
||||
Err(Exceptions::NotFoundException(None))
|
||||
}
|
||||
@@ -322,10 +322,10 @@ impl<'a> WhiteRectangleDetector<'_> {
|
||||
*/
|
||||
fn center_edges(
|
||||
&self,
|
||||
y: &RXingResultPoint,
|
||||
z: &RXingResultPoint,
|
||||
x: &RXingResultPoint,
|
||||
t: &RXingResultPoint,
|
||||
y: RXingResultPoint,
|
||||
z: RXingResultPoint,
|
||||
x: RXingResultPoint,
|
||||
t: RXingResultPoint,
|
||||
) -> [RXingResultPoint; 4] {
|
||||
//
|
||||
// t t
|
||||
|
||||
Reference in New Issue
Block a user