diff --git a/src/common/cpp_essentials/base_extentions/qr_formatinformation.rs b/src/common/cpp_essentials/base_extentions/qr_formatinformation.rs index ebd87e6..4198fc8 100644 --- a/src/common/cpp_essentials/base_extentions/qr_formatinformation.rs +++ b/src/common/cpp_essentials/base_extentions/qr_formatinformation.rs @@ -92,8 +92,7 @@ impl FormatInformation { } pub fn MirrorBits(bits: u32) -> u32 { - todo!() - // return BitHacks::Reverse(bits) >> 17; + (bits.reverse_bits()) >> 17 } pub fn FindBestFormatInfo(mask: u32, lookup: [[u32; 2]; 32], bits: &[u32]) -> Self { @@ -115,7 +114,8 @@ impl FormatInformation { // return fi; } + // Hamming distance of the 32 masked codes is 7, by construction, so <= 3 bits differing means we found a match pub fn isValid(&self) -> bool { - todo!() + self.hammingDistance <= 3 } } diff --git a/src/common/cpp_essentials/fast_edge_to_edge_counter.rs b/src/common/cpp_essentials/fast_edge_to_edge_counter.rs index c1a5fcb..1016c8a 100644 --- a/src/common/cpp_essentials/fast_edge_to_edge_counter.rs +++ b/src/common/cpp_essentials/fast_edge_to_edge_counter.rs @@ -4,6 +4,9 @@ pub struct FastEdgeToEdgeCounter { // const uint8_t* p = nullptr; // int stride = 0; // int stepsToBorder = 0; + p: usize, + stride: usize, // = 0; + stepsToBorder: usize, // = 0; } impl FastEdgeToEdgeCounter {