move some functions around

This commit is contained in:
Henry Schimke
2023-03-20 16:39:19 -05:00
parent 372bb454c0
commit f852e14331
2 changed files with 12 additions and 25 deletions

View File

@@ -18,7 +18,7 @@ impl BitMatrix {
let yOffset = top + y as f32 * subSampling; let yOffset = top + y as f32 * subSampling;
for x in 0..result.width() { for x in 0..result.width() {
// for (int x = 0; x < result.width(); x++) { // 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); result.set(x, y);
} }
} }
@@ -27,6 +27,14 @@ impl BitMatrix {
Ok(result) 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( pub fn findBoundingBox(
&self, &self,
left: u32, left: u32,
@@ -36,26 +44,5 @@ impl BitMatrix {
minSize: u32, minSize: u32,
) -> (bool, u32, u32, u32, u32) { ) -> (bool, u32, u32, u32, u32) {
todo!() 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;
} }
} }

View File

@@ -930,7 +930,7 @@ impl ECBlocks {
} }
} }
pub fn getECCodewordsPerBlock(&self) -> u32 { pub const fn getECCodewordsPerBlock(&self) -> u32 {
self.ecCodewordsPerBlock self.ecCodewordsPerBlock
} }
@@ -970,11 +970,11 @@ impl ECB {
} }
} }
pub fn getCount(&self) -> u32 { pub const fn getCount(&self) -> u32 {
self.count self.count
} }
pub fn getDataCodewords(&self) -> u32 { pub const fn getDataCodewords(&self) -> u32 {
self.dataCodewords self.dataCodewords
} }
} }