mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
move some functions around
This commit is contained in:
@@ -18,7 +18,7 @@ impl BitMatrix {
|
||||
let yOffset = top + y as f32 * subSampling;
|
||||
for x in 0..result.width() {
|
||||
// for (int x = 0; x < result.width(); x++) {
|
||||
if (self.get_point(point(left + x as f32 * subSampling, yOffset))) {
|
||||
if self.get_point(point(left + x as f32 * subSampling, yOffset)) {
|
||||
result.set(x, y);
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,14 @@ impl BitMatrix {
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
pub fn getTopLeftOnBitWithPosition(&self, left: u32, top: u32) -> (bool, u32, u32) {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn getBottomRightOnBitWithPosition(&self, right: u32, bottom: u32) -> (bool, u32, u32) {
|
||||
todo!()
|
||||
}
|
||||
|
||||
pub fn findBoundingBox(
|
||||
&self,
|
||||
left: u32,
|
||||
@@ -36,26 +44,5 @@ impl BitMatrix {
|
||||
minSize: u32,
|
||||
) -> (bool, u32, u32, u32, u32) {
|
||||
todo!()
|
||||
// let right;
|
||||
// let bottom;
|
||||
// if (!self.getTopLeftOnBitWithPosition(left, top) || !self.getBottomRightOnBitWithPosition(right, bottom) || bottom - top + 1 < minSize)
|
||||
// {return false;}
|
||||
|
||||
// for (int y = top; y <= bottom; y++ ) {
|
||||
// for (int x = 0; x < left; ++x)
|
||||
// if (get(x, y)) {
|
||||
// left = x;
|
||||
// break;
|
||||
// }
|
||||
// for (int x = _width-1; x > right; x--)
|
||||
// if (get(x, y)) {
|
||||
// right = x;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// width = right - left + 1;
|
||||
// height = bottom - top + 1;
|
||||
// return width >= minSize && height >= minSize;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -930,7 +930,7 @@ impl ECBlocks {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn getECCodewordsPerBlock(&self) -> u32 {
|
||||
pub const fn getECCodewordsPerBlock(&self) -> u32 {
|
||||
self.ecCodewordsPerBlock
|
||||
}
|
||||
|
||||
@@ -970,11 +970,11 @@ impl ECB {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn getCount(&self) -> u32 {
|
||||
pub const fn getCount(&self) -> u32 {
|
||||
self.count
|
||||
}
|
||||
|
||||
pub fn getDataCodewords(&self) -> u32 {
|
||||
pub const fn getDataCodewords(&self) -> u32 {
|
||||
self.dataCodewords
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user