Lines Matching defs:mask
68 static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]);
73 static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask);
118 // For automatic mask pattern selection.
130 enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) {
134 return qrcodegen_encodeSegmentsAdvanced(NULL, 0, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode);
158 return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, tempBuffer, qrcode);
168 enum qrcodegen_Ecc ecl, int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl) {
179 return qrcodegen_encodeSegmentsAdvanced(&seg, 1, ecl, minVersion, maxVersion, mask, boostEcl, dataAndTemp, qrcode);
205 int minVersion, int maxVersion, enum qrcodegen_Mask mask, bool boostEcl, uint8_t tempBuffer[], uint8_t qrcode[]) {
208 assert(0 <= (int)ecl && (int)ecl <= 3 && -1 <= (int)mask && (int)mask <= 7);
266 if (mask == qrcodegen_Mask_AUTO) { // Automatically choose best mask
274 mask = msk;
277 applyMask(tempBuffer, qrcode, msk); // Undoes the mask due to XOR
280 assert(0 <= (int)mask && (int)mask <= 7);
281 applyMask(tempBuffer, qrcode, mask); // Apply the final choice of mask
282 drawFormatBits(ecl, mask, qrcode); // Overwrite old format bits
514 // on the given mask and error correction level. This always draws all modules of
516 static void drawFormatBits(enum qrcodegen_Ecc ecl, enum qrcodegen_Mask mask, uint8_t qrcode[]) {
518 assert(0 <= (int)mask && (int)mask <= 7);
520 int data = table[(int)ecl] << 3 | (int)mask; // errCorrLvl is uint2, mask is uint3
603 // XORs the codeword modules in this QR Code with the given mask pattern
606 // the same mask value a second time will undo the mask. A final well-formed
607 // QR Code needs exactly one (not zero, two, etc.) mask applied.
608 static void applyMask(const uint8_t functionModules[], uint8_t qrcode[], enum qrcodegen_Mask mask) {
609 assert(0 <= (int)mask && (int)mask <= 7); // Disallows qrcodegen_Mask_AUTO
616 switch ((int)mask) {
635 // This is used by the automatic mask choice algorithm to find the mask pattern that yields the lowest score.