Lines Matching defs:mode
84 testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars);
86 static int numCharCountBits(enum qrcodegen_Mode mode, int version);
92 // The set of all legal characters in alphanumeric mode, where each character
151 seg.mode = qrcodegen_Mode_BYTE;
152 seg.bitLength = calcSegmentBitLength(seg.mode, textLen);
171 seg.mode = qrcodegen_Mode_BYTE;
172 seg.bitLength = calcSegmentBitLength(seg.mode, dataLen);
235 appendBitsToBuffer((unsigned int)seg->mode, 4, qrcode, &bitLen);
236 appendBitsToBuffer((unsigned int)seg->numChars, numCharCountBits(seg->mode, version), qrcode, &bitLen);
832 size_t qrcodegen_calcSegmentBufferSize(enum qrcodegen_Mode mode, size_t numChars) {
833 int temp = calcSegmentBitLength(mode, numChars);
842 // containing the given number of characters using the given mode. Notes:
846 // - For byte mode, numChars measures the number of bytes, not Unicode code points.
847 // - For ECI mode, numChars must be 0, and the worst-case number of bits is returned.
849 testable int calcSegmentBitLength(enum qrcodegen_Mode mode, size_t numChars) {
854 if (mode == qrcodegen_Mode_NUMERIC)
856 else if (mode == qrcodegen_Mode_ALPHANUMERIC)
858 else if (mode == qrcodegen_Mode_BYTE)
860 else if (mode == qrcodegen_Mode_KANJI)
862 else if (mode == qrcodegen_Mode_ECI && numChars == 0)
879 result.mode = qrcodegen_Mode_BYTE;
880 result.bitLength = calcSegmentBitLength(result.mode, len);
895 result.mode = qrcodegen_Mode_NUMERIC;
896 int bitLen = calcSegmentBitLength(result.mode, len);
929 result.mode = qrcodegen_Mode_ALPHANUMERIC;
930 int bitLen = calcSegmentBitLength(result.mode, len);
961 result.mode = qrcodegen_Mode_ECI;
996 int ccbits = numCharCountBits(segs[i].mode, version);
1009 // Returns the bit width of the character count field for a segment in the given mode
1011 static int numCharCountBits(enum qrcodegen_Mode mode, int version) {
1014 switch (mode) {