Lines Matching full:version

57 testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t resu…
58 testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl);
66 testable void initializeFunctionModules(int version, uint8_t qrcode[]);
67 static void drawWhiteFunctionModules(uint8_t qrcode[], int version);
69 testable int getAlignmentPatternPositions(int version, uint8_t result[7]);
85 testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version);
86 static int numCharCountBits(enum qrcodegen_Mode mode, int version);
98 // Version: (note that index 0 is for padding, and is set to an illegal value)
110 // Version: (note that index 0 is for padding, and is set to an illegal value)
210 // Find the minimal version number to use in qrcodegen_encodeSegmentsAdvanced()
211 int version, dataUsedBits; in qrcodegen_encodeSegmentsAdvanced() local
212 for (version = minVersion; ; version++) { in qrcodegen_encodeSegmentsAdvanced()
213 int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available in qrcodegen_encodeSegmentsAdvanced()
214 dataUsedBits = getTotalBits(segs, len, version); in qrcodegen_encodeSegmentsAdvanced()
216 break; // This version number is found to be suitable in qrcodegen_encodeSegmentsAdvanced()
217 if (version >= maxVersion) { // All versions in the range could not fit the given data in qrcodegen_encodeSegmentsAdvanced()
224 // Increase the error correction level while the data still fits in the current version number in qrcodegen_encodeSegmentsAdvanced()
226 if (boostEcl && dataUsedBits <= getNumDataCodewords(version, (enum qrcodegen_Ecc)i) * 8) in qrcodegen_encodeSegmentsAdvanced()
231 memset(qrcode, 0, (size_t)qrcodegen_BUFFER_LEN_FOR_VERSION(version) * sizeof(qrcode[0])); in qrcodegen_encodeSegmentsAdvanced()
236 …appendBitsToBuffer((unsigned int)seg->numChars, numCharCountBits(seg->mode, version), qrcode, &bit… in qrcodegen_encodeSegmentsAdvanced()
245 int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; in qrcodegen_encodeSegmentsAdvanced()
259 addEccAndInterleave(qrcode, version, ecl, tempBuffer); in qrcodegen_encodeSegmentsAdvanced()
260 initializeFunctionModules(version, qrcode); in qrcodegen_encodeSegmentsAdvanced()
261 drawCodewords(tempBuffer, getNumRawDataModules(version) / 8, qrcode); in qrcodegen_encodeSegmentsAdvanced()
262 drawWhiteFunctionModules(qrcode, version); in qrcodegen_encodeSegmentsAdvanced()
263 initializeFunctionModules(version, tempBuffer); in qrcodegen_encodeSegmentsAdvanced()
294 testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t resu… in addEccAndInterleave() argument
296 …assert(0 <= (int)ecl && (int)ecl < 4 && qrcodegen_VERSION_MIN <= version && version <= qrcodegen_V… in addEccAndInterleave()
297 int numBlocks = NUM_ERROR_CORRECTION_BLOCKS[(int)ecl][version]; in addEccAndInterleave()
298 int blockEccLen = ECC_CODEWORDS_PER_BLOCK [(int)ecl][version]; in addEccAndInterleave()
299 int rawCodewords = getNumRawDataModules(version) / 8; in addEccAndInterleave()
300 int dataLen = getNumDataCodewords(version, ecl); in addEccAndInterleave()
326 // for the given version number and error correction level. The result is in the range [9, 2956].
327 testable int getNumDataCodewords(int version, enum qrcodegen_Ecc ecl) { in getNumDataCodewords() argument
328 int v = version, e = (int)ecl; in getNumDataCodewords()
336 // Returns the number of data bits that can be stored in a QR Code of the given version number, aft…
417 // version's size, then marks every function module as black.
418 testable void initializeFunctionModules(int version, uint8_t qrcode[]) { in initializeFunctionModules() argument
420 int qrsize = version * 4 + 17; in initializeFunctionModules()
435 int numAlign = getAlignmentPatternPositions(version, alignPatPos); in initializeFunctionModules()
444 // Fill version blocks in initializeFunctionModules()
445 if (version >= 7) { in initializeFunctionModules()
455 static void drawWhiteFunctionModules(uint8_t qrcode[], int version) { in drawWhiteFunctionModules() argument
479 int numAlign = getAlignmentPatternPositions(version, alignPatPos); in drawWhiteFunctionModules()
491 // Draw version blocks in drawWhiteFunctionModules()
492 if (version >= 7) { in drawWhiteFunctionModules()
494 int rem = version; // version is uint6, in the range [7, 40] in drawWhiteFunctionModules()
497 long bits = (long)version << 12 | rem; // uint18 in drawWhiteFunctionModules()
547 // for this version number, returning the length of the list (in the range [0,7]).
550 testable int getAlignmentPatternPositions(int version, uint8_t result[7]) { in getAlignmentPatternPositions() argument
551 if (version == 1) in getAlignmentPatternPositions()
553 int numAlign = version / 7 + 2; in getAlignmentPatternPositions()
554 int step = (version == 32) ? 26 : in getAlignmentPatternPositions()
555 (version*4 + numAlign*2 + 1) / (numAlign*2 - 2) * 2; in getAlignmentPatternPositions()
556 for (int i = numAlign - 1, pos = version * 4 + 10; i >= 1; i--, pos -= step) in getAlignmentPatternPositions()
985 // Calculates the number of bits needed to encode the given segments at the given version.
988 testable int getTotalBits(const struct qrcodegen_Segment segs[], size_t len, int version) { in getTotalBits() argument
996 int ccbits = numCharCountBits(segs[i].mode, version); in getTotalBits()
1010 // in a QR Code at the given version number. The result is in the range [0, 16].
1011 static int numCharCountBits(enum qrcodegen_Mode mode, int version) { in numCharCountBits() argument
1012 assert(qrcodegen_VERSION_MIN <= version && version <= qrcodegen_VERSION_MAX); in numCharCountBits()
1013 int i = (version + 7) / 17; in numCharCountBits()