Lines Matching refs:numchars
286 bb.append_bits(u32::try_from(seg.numchars).unwrap(), seg.mode.num_char_count_bits(version));
1083 numchars: usize,
1089 // The character count (numchars) must agree with the mode and the bit buffer length.
1184 /// The character count (numchars) must agree with the mode and
1186 pub fn new(mode: QrSegmentMode, numchars: usize, data: &'a [u8], bitlength: usize) -> Self {
1188 Self { mode, numchars, data, bitlength }
1202 self.numchars
1213 /// - For byte mode, numchars measures the number of bytes, not Unicode code points.
1214 /// - For ECI mode, numchars must be 0, and the worst-case number of bytes is returned.
1216 pub fn calc_buffer_size(mode: QrSegmentMode, numchars: usize) -> Option<usize> {
1217 let temp = Self::calc_bit_length(mode, numchars)?;
1225 // - For byte mode, numchars measures the number of bytes, not Unicode code points.
1226 // - For ECI mode, numchars must be 0, and the worst-case number of bits is returned.
1228 fn calc_bit_length(mode: QrSegmentMode, numchars: usize) -> Option<usize> {
1229 // Returns ceil((numer / denom) * numchars)
1231 Some(numchars)
1243 assert_eq!(numchars, 0);
1259 if seg.numchars >= limit {