Lines Matching refs:result
59 …le void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]);
63 testable void calcReedSolomonGenerator(int degree, uint8_t result[]);
65 const uint8_t generator[], int degree, uint8_t result[]);
71 testable int getAlignmentPatternPositions(int version, uint8_t result[7]);
300 …ble void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]) in addEccAndInterleave() argument
323 result[k] = dat[j]; in addEccAndInterleave()
326 result[k] = ecc[j]; in addEccAndInterleave()
350 int result = (16 * ver + 128) * ver + 64; in getNumRawDataModules() local
353 result -= (25 * numAlign - 10) * numAlign - 55; in getNumRawDataModules()
355 result -= 36; in getNumRawDataModules()
357 return result; in getNumRawDataModules()
365 testable void calcReedSolomonGenerator(int degree, uint8_t result[]) in calcReedSolomonGenerator() argument
369 memset(result, 0, degree * sizeof(result[0])); in calcReedSolomonGenerator()
370 result[degree - 1] = 1; in calcReedSolomonGenerator()
379 result[j] = finiteFieldMultiply(result[j], root); in calcReedSolomonGenerator()
381 result[j] ^= result[j + 1]; in calcReedSolomonGenerator()
391 const uint8_t generator[], int degree, uint8_t result[]) in calcReedSolomonRemainder() argument
396 memset(result, 0, degree * sizeof(result[0])); in calcReedSolomonRemainder()
398 uint8_t factor = data[i] ^ result[0]; in calcReedSolomonRemainder()
399 memmove(&result[0], &result[1], (degree - 1) * sizeof(result[0])); in calcReedSolomonRemainder()
400 result[degree - 1] = 0; in calcReedSolomonRemainder()
402 result[j] ^= finiteFieldMultiply(generator[j], factor); in calcReedSolomonRemainder()
563 testable int getAlignmentPatternPositions(int version, uint8_t result[7]) in getAlignmentPatternPositions()
571 result[i] = pos; in getAlignmentPatternPositions()
572 result[0] = 6; in getAlignmentPatternPositions()
674 long result = 0; in getPenaltyScore() local
685 result += PENALTY_N1; in getPenaltyScore()
687 result++; in getPenaltyScore()
692 result += PENALTY_N3; in getPenaltyScore()
701 result += PENALTY_N3; in getPenaltyScore()
712 result += PENALTY_N1; in getPenaltyScore()
714 result++; in getPenaltyScore()
719 result += PENALTY_N3; in getPenaltyScore()
728 result += PENALTY_N3; in getPenaltyScore()
738 result += PENALTY_N2; in getPenaltyScore()
753 result += k * PENALTY_N4; in getPenaltyScore()
754 return result; in getPenaltyScore()
787 int result = qrcode[0]; in qrcodegen_getSize() local
788 LV_ASSERT((qrcodegen_VERSION_MIN * 4 + 17) <= result in qrcodegen_getSize()
789 && result <= (qrcodegen_VERSION_MAX * 4 + 17)); in qrcodegen_getSize()
790 return result; in qrcodegen_getSize()
895 long result = (long)numChars; in calcSegmentBitLength() local
897 result = (result * 10 + 2) / 3; // ceil(10/3 * n) in calcSegmentBitLength()
899 result = (result * 11 + 1) / 2; // ceil(11/2 * n) in calcSegmentBitLength()
901 result *= 8; in calcSegmentBitLength()
903 result *= 13; in calcSegmentBitLength()
905 result = 3 * 8; in calcSegmentBitLength()
910 LV_ASSERT(result >= 0); in calcSegmentBitLength()
911 if((unsigned int)result > (unsigned int)INT16_MAX) in calcSegmentBitLength()
913 return (int)result; in calcSegmentBitLength()
921 struct qrcodegen_Segment result; in qrcodegen_makeBytes() local
922 result.mode = qrcodegen_Mode_BYTE; in qrcodegen_makeBytes()
923 result.bitLength = calcSegmentBitLength(result.mode, len); in qrcodegen_makeBytes()
924 LV_ASSERT(result.bitLength != -1); in qrcodegen_makeBytes()
925 result.numChars = (int)len; in qrcodegen_makeBytes()
928 result.data = buf; in qrcodegen_makeBytes()
929 return result; in qrcodegen_makeBytes()
937 struct qrcodegen_Segment result; in qrcodegen_makeNumeric() local
939 result.mode = qrcodegen_Mode_NUMERIC; in qrcodegen_makeNumeric()
940 int bitLen = calcSegmentBitLength(result.mode, len); in qrcodegen_makeNumeric()
942 result.numChars = (int)len; in qrcodegen_makeNumeric()
945 result.bitLength = 0; in qrcodegen_makeNumeric()
955 appendBitsToBuffer(accumData, 10, buf, &result.bitLength); in qrcodegen_makeNumeric()
961 appendBitsToBuffer(accumData, accumCount * 3 + 1, buf, &result.bitLength); in qrcodegen_makeNumeric()
962 LV_ASSERT(result.bitLength == bitLen); in qrcodegen_makeNumeric()
963 result.data = buf; in qrcodegen_makeNumeric()
964 return result; in qrcodegen_makeNumeric()
972 struct qrcodegen_Segment result; in qrcodegen_makeAlphanumeric() local
974 result.mode = qrcodegen_Mode_ALPHANUMERIC; in qrcodegen_makeAlphanumeric()
975 int bitLen = calcSegmentBitLength(result.mode, len); in qrcodegen_makeAlphanumeric()
977 result.numChars = (int)len; in qrcodegen_makeAlphanumeric()
980 result.bitLength = 0; in qrcodegen_makeAlphanumeric()
990 appendBitsToBuffer(accumData, 11, buf, &result.bitLength); in qrcodegen_makeAlphanumeric()
996 appendBitsToBuffer(accumData, 6, buf, &result.bitLength); in qrcodegen_makeAlphanumeric()
997 LV_ASSERT(result.bitLength == bitLen); in qrcodegen_makeAlphanumeric()
998 result.data = buf; in qrcodegen_makeAlphanumeric()
999 return result; in qrcodegen_makeAlphanumeric()
1006 struct qrcodegen_Segment result; in qrcodegen_makeEci() local
1007 result.mode = qrcodegen_Mode_ECI; in qrcodegen_makeEci()
1008 result.numChars = 0; in qrcodegen_makeEci()
1009 result.bitLength = 0; in qrcodegen_makeEci()
1015 appendBitsToBuffer(assignVal, 8, buf, &result.bitLength); in qrcodegen_makeEci()
1019 appendBitsToBuffer(2, 2, buf, &result.bitLength); in qrcodegen_makeEci()
1020 appendBitsToBuffer(assignVal, 14, buf, &result.bitLength); in qrcodegen_makeEci()
1024 appendBitsToBuffer(6, 3, buf, &result.bitLength); in qrcodegen_makeEci()
1025 appendBitsToBuffer(assignVal >> 10, 11, buf, &result.bitLength); in qrcodegen_makeEci()
1026 appendBitsToBuffer(assignVal & 0x3FF, 10, buf, &result.bitLength); in qrcodegen_makeEci()
1031 result.data = buf; in qrcodegen_makeEci()
1032 return result; in qrcodegen_makeEci()
1042 long result = 0; in getTotalBits() local
1052 result += 4L + ccbits + bitLength; in getTotalBits()
1053 if(result > INT16_MAX) in getTotalBits()
1056 LV_ASSERT(0 <= result && result <= INT16_MAX); in getTotalBits()
1057 return (int)result; in getTotalBits()