mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
partial success on parse, missing symbology id
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
use std::fmt;
|
||||
|
||||
use crate::common::Result;
|
||||
use crate::{point, Exceptions, Point};
|
||||
use crate::{point, Exceptions, Point, point_i};
|
||||
|
||||
use super::BitArray;
|
||||
|
||||
@@ -223,7 +223,14 @@ impl BitMatrix {
|
||||
}
|
||||
|
||||
pub fn get_index<T: Into<usize>>(&self, index: T) -> bool {
|
||||
todo!()
|
||||
self.get_point(self.calculate_point_from_index(index.into()))
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn calculate_point_from_index(&self, index: usize) -> Point {
|
||||
let row = index / (self.getWidth() as usize);
|
||||
let column = index % (self.getWidth() as usize);
|
||||
point_i(column as u32, row as u32)
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use crate::common::BitMatrix;
|
||||
|
||||
use super::BitMatrixCursorTrait;
|
||||
|
||||
pub struct FastEdgeToEdgeCounter {
|
||||
@@ -9,11 +11,11 @@ pub struct FastEdgeToEdgeCounter {
|
||||
stepsToBorder: i32, // = 0;
|
||||
//arr: BitArray,
|
||||
_arr: isize,
|
||||
under_arry: Vec<bool>,
|
||||
under_arry: Vec<bool>//&'a BitMatrix//,
|
||||
}
|
||||
|
||||
impl FastEdgeToEdgeCounter {
|
||||
pub fn new<T: BitMatrixCursorTrait>(cur: &T) -> Self {
|
||||
pub fn new<T: BitMatrixCursorTrait>(cur: &T) -> FastEdgeToEdgeCounter {
|
||||
let stride = cur.d().y as isize * cur.img().width() as isize + cur.d().x as isize;
|
||||
let p = ((cur.p().y as isize * cur.img().width() as isize).abs() as i32 + cur.p().x as i32) as u32; // P IS SET WRONG IN REVERSE
|
||||
|
||||
@@ -37,7 +39,7 @@ impl FastEdgeToEdgeCounter {
|
||||
};
|
||||
let stepsToBorder = std::cmp::min(maxStepsX, maxStepsY) as i32;
|
||||
|
||||
Self {
|
||||
FastEdgeToEdgeCounter {
|
||||
p,
|
||||
stride,
|
||||
stepsToBorder,
|
||||
@@ -63,6 +65,7 @@ impl FastEdgeToEdgeCounter {
|
||||
|
||||
if !(self.under_arry[idx_pt]
|
||||
== self.under_arry[self.p as usize])
|
||||
// if !(self.under_arry.get_index(idx_pt) == self.under_arry.get_index(self.p as usize))
|
||||
{
|
||||
break true;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ impl GridSampler for DefaultGridSampler {
|
||||
Point::default()
|
||||
};
|
||||
|
||||
let tl = projectCorner(point(0.0, 0.0));
|
||||
let tl = projectCorner(Point::default());
|
||||
let tr = projectCorner(Point::from((dimensionX, 0)));
|
||||
let bl = projectCorner(Point::from((dimensionX, dimensionY)));
|
||||
let br = projectCorner(Point::from((0, dimensionX)));
|
||||
|
||||
Reference in New Issue
Block a user