mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-28 05:12:34 +00:00
all integrations pass
This commit is contained in:
@@ -203,6 +203,12 @@ impl BitMatrix {
|
|||||||
return ((self.bits[offset] >> (x & 0x1f)) & 1) != 0;
|
return ((self.bits[offset] >> (x & 0x1f)) & 1) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn try_get(&self, x: u32, y: u32) -> Result<bool,Exceptions> {
|
||||||
|
let offset = y as usize * self.row_size + (x as usize / 32);
|
||||||
|
if offset > self.bits.len() { return Err(Exceptions::IndexOutOfBoundsException("".to_owned()))}
|
||||||
|
return Ok(((self.bits[offset] >> (x & 0x1f)) & 1) != 0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>Sets the given bit to true.</p>
|
* <p>Sets the given bit to true.</p>
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -817,6 +817,7 @@ fn adjustCodewordStartColumn(
|
|||||||
return codewordStartColumn;
|
return codewordStartColumn;
|
||||||
}
|
}
|
||||||
correctedStartColumn = (correctedStartColumn as i32 + increment) as u32;
|
correctedStartColumn = (correctedStartColumn as i32 + increment) as u32;
|
||||||
|
if let Err(_) = image.try_get(correctedStartColumn, imageRow){return 0}
|
||||||
}
|
}
|
||||||
increment = -increment;
|
increment = -increment;
|
||||||
leftToRight = !leftToRight;
|
leftToRight = !leftToRight;
|
||||||
|
|||||||
@@ -88,6 +88,7 @@ fn qrcode_black_box4_test_case() {
|
|||||||
let mut tester = common::AbstractBlackBoxTestCase::new(
|
let mut tester = common::AbstractBlackBoxTestCase::new(
|
||||||
"test_resources/blackbox/qrcode-4",
|
"test_resources/blackbox/qrcode-4",
|
||||||
MultiFormatReader::default(),
|
MultiFormatReader::default(),
|
||||||
|
// QRCodeReader::new(),
|
||||||
BarcodeFormat::QR_CODE,
|
BarcodeFormat::QR_CODE,
|
||||||
);
|
);
|
||||||
tester.add_test(36, 36, 0.0);
|
tester.add_test(36, 36, 0.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user