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:
@@ -91,7 +91,7 @@ pub fn ReadFormatInformation(bitMatrix: &BitMatrix, isMicro: bool) -> Result<For
|
||||
AppendBit(&mut formatInfoBits1, getBit(bitMatrix, 8, 8, None));
|
||||
AppendBit(&mut formatInfoBits1, getBit(bitMatrix, 8, 7, None));
|
||||
// .. and skip a bit in the timing pattern ...
|
||||
for y in (0..=6).rev() {
|
||||
for y in (0..=5).rev() {
|
||||
// for (int y = 5; y >= 0; y--)
|
||||
AppendBit(&mut formatInfoBits1, getBit(bitMatrix, 8, y, None));
|
||||
}
|
||||
@@ -130,7 +130,7 @@ pub fn ReadQRCodewords(
|
||||
let mut bitsRead = 0;
|
||||
let dimension = bitMatrix.height();
|
||||
// Read columns in pairs, from right to left
|
||||
let mut x = dimension - 1;
|
||||
let mut x = (dimension as i32) - 1;
|
||||
while x > 0 {
|
||||
// for (int x = dimension - 1; x > 0; x -= 2) {
|
||||
// Skip whole column with vertical timing pattern.
|
||||
@@ -143,7 +143,7 @@ pub fn ReadQRCodewords(
|
||||
let y = if readingUp { dimension - 1 - row } else { row };
|
||||
for col in 0..2 {
|
||||
// for (int col = 0; col < 2; col++) {
|
||||
let xx = x - col;
|
||||
let xx = (x - col) as u32;
|
||||
// Ignore bits covered by the function pattern
|
||||
if (!functionPattern.get(xx, y)) {
|
||||
// Read a bit
|
||||
|
||||
@@ -428,7 +428,7 @@ pub fn Decode(bits: &BitMatrix) -> Result<DecoderResult<bool>> {
|
||||
}
|
||||
|
||||
// resultIterator = std::copy_n(codewordBytes.begin(), numDataCodewords, resultIterator);
|
||||
resultBytes[resultIterator..numDataCodewords]
|
||||
resultBytes[resultIterator..(resultIterator+numDataCodewords)]
|
||||
.copy_from_slice(&codewordBytes[..numDataCodewords]);
|
||||
resultIterator += numDataCodewords;
|
||||
}
|
||||
|
||||
@@ -747,8 +747,8 @@ pub fn SampleQR(image: &BitMatrix, fp: &FinderPatternSet) -> Result<QRCodeDetect
|
||||
dimension as u32,
|
||||
dimension as u32,
|
||||
&[SamplerControl {
|
||||
p0: point_i(0, dimension as u32),
|
||||
p1: point_i(0, dimension as u32),
|
||||
p1: point_i(dimension as u32, dimension as u32),
|
||||
p0: point_i(0,0 ),
|
||||
transform: mod2Pix,
|
||||
}],
|
||||
)?;
|
||||
|
||||
@@ -218,12 +218,13 @@ impl<'a> Detector<'_> {
|
||||
dimension: u32,
|
||||
) -> Result<BitMatrix> {
|
||||
let sampler = DefaultGridSampler::default();
|
||||
sampler.sample_grid(
|
||||
let (res, _) = sampler.sample_grid(
|
||||
image,
|
||||
dimension,
|
||||
dimension,
|
||||
&[SamplerControl::new(dimension, dimension, transform)],
|
||||
)
|
||||
)?;
|
||||
Ok(res)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user