Lines Matching defs:data
57 testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]);
62 testable void reedSolomonComputeRemainder(const uint8_t data[], int dataLen,
72 static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]);
156 seg.data = tempBuffer;
178 seg.data = dataAndTemp;
213 int dataCapacityBits = getNumDataCodewords(version, ecl) * 8; // Number of data bits available
217 if (version >= maxVersion) { // All versions in the range could not fit the given data
224 // Increase the error correction level while the data still fits in the current version number
230 // Concatenate all segments to create the data bit string
238 int bit = (seg->data[j >> 3] >> (7 - (j & 7))) & 1;
254 // Pad with alternating bytes until data capacity is reached
290 // Appends error correction bytes to each block of the given data array, then interleaves
291 // bytes from the blocks and stores them in the result array. data[0 : dataLen] contains
292 // the input data. data[dataLen : rawCodewords] is used as a temporary work area and will
294 testable void addEccAndInterleave(uint8_t data[], int version, enum qrcodegen_Ecc ecl, uint8_t result[]) {
304 // Split data into blocks, calculate ECC, and interleave
308 const uint8_t *dat = data;
311 uint8_t *ecc = &data[dataLen]; // Temporary storage
313 for (int j = 0, k = i; j < datLen; j++, k += numBlocks) { // Copy data
325 // Returns the number of 8-bit codewords that can be used for storing data (not ECC),
336 // Returns the number of data bits that can be stored in a QR Code of the given version number, after
381 // Computes the Reed-Solomon error correction codeword for the given data and divisor polynomials.
382 // The remainder when data[0 : dataLen] is divided by divisor[0 : degree] is stored in result[0 : degree].
384 testable void reedSolomonComputeRemainder(const uint8_t data[], int dataLen,
389 uint8_t factor = data[i] ^ result[0];
520 int data = table[(int)ecl] << 3 | (int)mask; // errCorrLvl is uint2, mask is uint3
521 int rem = data;
524 int bits = (data << 10 | rem) ^ 0x5412; // uint15
573 /*---- Drawing data modules and masking ----*/
575 // Draws the raw codewords (including data and ECC) onto the given QR Code. This requires the initial state of
577 static void drawCodewords(const uint8_t data[], int dataLen, uint8_t qrcode[]) {
579 int i = 0; // Bit index into the data
590 bool dark = getBit(data[i >> 3], 7 - (i & 7));
841 // Returns the number of data bits needed to represent a segment
848 // An actual ECI segment can have shorter data. For non-ECI modes, the result is exact.
876 struct qrcodegen_Segment qrcodegen_makeBytes(const uint8_t data[], size_t len, uint8_t buf[]) {
877 assert(data != NULL || len == 0);
884 memcpy(buf, data, len * sizeof(buf[0]));
885 result.data = buf;
919 result.data = buf;
953 result.data = buf;
980 result.data = buf;