mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 04:12:34 +00:00
mqr tests pass
This commit is contained in:
@@ -197,7 +197,7 @@ impl<'a> PatternView<'a> {
|
|||||||
self.isValidWithN(self.size())
|
self.isValidWithN(self.size())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn has_quiet_zone_before(&self, scale: f32, acceptIfAtFirstBar: Option<bool>) -> bool {
|
pub fn has_quiet_zone_before(&self, scale: f32, acceptIfAtFirstBar: Option<bool>) -> bool {
|
||||||
(acceptIfAtFirstBar.unwrap_or(false) && self.isAtLastBar())
|
(acceptIfAtFirstBar.unwrap_or(false) && self.isAtLastBar())
|
||||||
|| Into::<f32>::into(self.data.0[self.count])
|
|| Into::<f32>::into(self.data.0[self.count])
|
||||||
>= Into::<f32>::into(self.sum(None)) * scale
|
>= Into::<f32>::into(self.sum(None)) * scale
|
||||||
|
|||||||
@@ -1023,8 +1023,8 @@ pub fn SampleMQR(image: &BitMatrix, fp: ConcentricPattern) -> Result<QRCodeDetec
|
|||||||
dim,
|
dim,
|
||||||
dim,
|
dim,
|
||||||
&[SamplerControl {
|
&[SamplerControl {
|
||||||
p0: point_i(0, dim as u32),
|
p1: point_i(dim as u32, dim as u32),
|
||||||
p1: point_i(0, dim as u32),
|
p0: point_i(0, 0),
|
||||||
transform: bestPT,
|
transform: bestPT,
|
||||||
}],
|
}],
|
||||||
)?;
|
)?;
|
||||||
|
|||||||
@@ -113,6 +113,9 @@ impl Version {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn getECBlocksForLevel(&self, ecLevel: ErrorCorrectionLevel) -> &ECBlocks {
|
pub fn getECBlocksForLevel(&self, ecLevel: ErrorCorrectionLevel) -> &ECBlocks {
|
||||||
|
if ecLevel.get_ordinal() as usize >= self.ecBlocks.len() {
|
||||||
|
return &self.ecBlocks[ecLevel.get_ordinal() as usize % self.ecBlocks.len()];
|
||||||
|
}
|
||||||
&self.ecBlocks[ecLevel.get_ordinal() as usize]
|
&self.ecBlocks[ecLevel.get_ordinal() as usize]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user