Lines Matching +full:75 +full:- +full:ec

1 // SPDX-License-Identifier: MIT
25 //! * <https://github.com/kennytm/qrcode-rust>
69 /// - Error Correction polynomial.
70 /// - Number of blocks in group 1.
71 /// - Number of blocks in group 2.
72 /// - Block size in group 1.
166 /// Version information for format V7-V40.
211 fn from_segments(segments: &[&Segment<'_>]) -> Option<Version> { in from_segments()
217 fn width(&self) -> u8 { in width()
221 fn max_data(&self) -> usize { in max_data()
225 fn ec_size(&self) -> usize { in ec_size()
226 VPARAM[self.0 - 1].0.len() in ec_size()
229 fn g1_blocks(&self) -> usize { in g1_blocks()
230 VPARAM[self.0 - 1].1 as usize in g1_blocks()
233 fn g2_blocks(&self) -> usize { in g2_blocks()
234 VPARAM[self.0 - 1].2 as usize in g2_blocks()
237 fn g1_blk_size(&self) -> usize { in g1_blk_size()
238 VPARAM[self.0 - 1].3 as usize in g1_blk_size()
241 fn alignment_pattern(&self) -> &'static [u8] { in alignment_pattern()
242 ALIGNMENT_PATTERNS[self.0 - 1] in alignment_pattern()
245 fn poly(&self) -> &'static [u8] { in poly()
246 VPARAM[self.0 - 1].0 in poly()
249 fn version_info(&self) -> u32 { in version_info()
251 VERSION_INFORMATION[self.0 - 7] in version_info()
268 145, 63, 126, 252, 229, 215, 179, 123, 246, 241, 255, 227, 219, 171, 75, 150, 49, 98, 196, 149,
277 175, 0, 1, 25, 2, 50, 26, 198, 3, 223, 51, 238, 27, 104, 199, 75, 4, 100, 224, 14, 52, 141,
300 fn get_next_13b(data: &[u8], offset: usize) -> Option<(u16, usize)> { in get_next_13b()
302 let size = cmp::min(13, data.len() * 8 - offset); in get_next_13b()
311 0..=8 => first_byte >> (8 - b), in get_next_13b()
312 9..=16 => (first_byte << (b - 8)) + (data[byte_off + 1] >> (16 - b)) as u16, in get_next_13b()
314 (first_byte << (b - 8)) in get_next_13b()
315 + ((data[byte_off + 1] as u16) << (b - 16)) in get_next_13b()
316 + (data[byte_off + 2] >> (24 - b)) as u16 in get_next_13b()
335 fn get_header(&self) -> (u16, usize) { in get_header()
343 fn length_bits_count(&self, version: Version) -> usize { in length_bits_count()
359 fn character_count(&self) -> usize { in character_count()
374 fn get_length_field(&self, version: Version) -> (u16, usize) { in get_length_field()
381 fn total_size_bits(&self, version: Version) -> usize { in total_size_bits()
393 fn iter(&self) -> SegmentIterator<'_> { in iter()
413 fn next(&mut self) -> Option<Self::Item> { in next()
437 self.carry_len = new_chars + self.carry_len - 3; in next()
439 self.carry * POW10[new_chars - self.carry_len] in next()
479 fn new<'a>(segments: &[&Segment<'_>], data: &'a mut [u8]) -> Option<EncodedMsg<'a>> { in new()
514 self.data[byte_off] = (number << (8 - b)) as u8; in push()
517 self.data[byte_off] = (number >> (b - 8)) as u8; in push()
518 self.data[byte_off + 1] = (number << (16 - b)) as u8; in push()
521 self.data[byte_off] |= (number << (8 - b)) as u8; in push()
524 self.data[byte_off] |= (number >> (b - 8)) as u8; in push()
525 self.data[byte_off + 1] = (number << (16 - b)) as u8; in push()
528 self.data[byte_off] |= (number >> (b - 8)) as u8; in push()
529 self.data[byte_off + 1] = (number >> (b - 16)) as u8; in push()
530 self.data[byte_off + 2] = (number << (24 - b)) as u8; in push()
593 fn iter(&self) -> EncodedMsgIterator<'_> { in iter()
612 fn next(&mut self) -> Option<Self::Item> { in next()
630 g1_end + em.g2_blk_size * (blk - em.g1_blocks) + blk_off in next()
634 let blk2 = self.offset - blocks * em.g1_blk_size; in next()
635 em.g1_blk_size * em.g1_blocks + blk2 * em.g2_blk_size + em.g2_blk_size - 1 in next()
637 // EC blocks in next()
638 let ec_offset = self.offset - g2_end; in next()
660 fn new<'a, 'b>(em: &'b EncodedMsg<'b>, qrdata: &'a mut [u8]) -> QrImage<'a> { in new()
706 self.draw_square(self.width - 6, 1, 4); in draw_finders()
707 self.draw_square(1, self.width - 6, 4); in draw_finders()
710 self.set(self.width - k - 1, 7); in draw_finders()
711 self.set(k, self.width - 8); in draw_finders()
715 self.set(self.width - 8, k); in draw_finders()
716 self.set(7, self.width - 1 - k); in draw_finders()
720 fn is_finder(&self, x: u8, y: u8) -> bool { in is_finder()
721 let end = self.width - 8; in is_finder()
734 self.draw_square(x - 1, y - 1, 2); in draw_alignments()
740 fn is_alignment(&self, x: u8, y: u8) -> bool { in is_alignment()
747 if x >= ax - 2 && x <= ax + 2 && y >= ay - 2 && y <= ay + 2 { in is_alignment()
757 let end = self.width - 8; in draw_timing_patterns()
765 fn is_timing(&self, x: u8, y: u8) -> bool { in is_timing()
778 if info & (1 << (14 - k)) == 0 { in draw_maskinfo()
780 self.set(8, self.width - 1 - k); in draw_maskinfo()
788 if info & (1 << (7 - k)) == 0 { in draw_maskinfo()
789 self.set(8, 8 - skip - k); in draw_maskinfo()
790 self.set(self.width - 8 + k, 8); in draw_maskinfo()
795 fn is_maskinfo(&self, x: u8, y: u8) -> bool { in is_maskinfo()
796 let end = self.width - 8; in is_maskinfo()
804 let pos = self.width - 11; in draw_version_info()
818 fn is_version_info(&self, x: u8, y: u8) -> bool { in is_version_info()
820 let pos = self.width - 11; in is_version_info()
825 // Returns true if the module is reserved (Not usable for data and EC).
826 fn is_reserved(&self, x: u8, y: u8) -> bool { in is_reserved()
835 fn is_last(&self, x: u8, y: u8) -> bool { in is_last()
836 x == 0 && y == self.width - 1 in is_last()
841 fn next(&self, x: u8, y: u8) -> (u8, u8) { in next()
843 let column_type = (self.width - x_adj) % 4; in next()
846 2 if y > 0 => (x + 1, y - 1), in next()
847 0 if y < self.width - 1 => (x + 1, y + 1), in next()
848 0 | 2 if x == 7 => (x - 2, y), in next()
849 _ => (x - 1, y), in next()
854 fn next_available(&self, x: u8, y: u8) -> (u8, u8) { in next_available()
863 let (mut x, mut y) = (self.width - 1, self.width - 1); in draw_data()
882 // Apply checkerboard mask to all non-reserved modules.
927 /// * `url` must be null or point at a nul-terminated string.
940 ) -> u8 { in drm_panic_qr_generate()
960 // nul-terminated string. in drm_panic_qr_generate()
977 /// * `version`: QR code version, between 1-40.
984 pub extern "C" fn drm_panic_qr_max_data_size(version: u8, url_len: usize) -> usize { in drm_panic_qr_max_data_size()
996 let max = max_data - url_len - 5; in drm_panic_qr_max_data_size()
1001 max_data - 3 in drm_panic_qr_max_data_size()