|
|
@ -238,7 +238,7 @@ int QrCode::getFormatBits(Ecc ecl) {
|
|
|
|
case Ecc::MEDIUM : return 0;
|
|
|
|
case Ecc::MEDIUM : return 0;
|
|
|
|
case Ecc::QUARTILE: return 3;
|
|
|
|
case Ecc::QUARTILE: return 3;
|
|
|
|
case Ecc::HIGH : return 2;
|
|
|
|
case Ecc::HIGH : return 2;
|
|
|
|
default: throw std::logic_error("Assertion error");
|
|
|
|
default: throw std::logic_error("Unreachable");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -584,7 +584,7 @@ void QrCode::applyMask(int msk) {
|
|
|
|
case 5: invert = x * y % 2 + x * y % 3 == 0; break;
|
|
|
|
case 5: invert = x * y % 2 + x * y % 3 == 0; break;
|
|
|
|
case 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break;
|
|
|
|
case 6: invert = (x * y % 2 + x * y % 3) % 2 == 0; break;
|
|
|
|
case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break;
|
|
|
|
case 7: invert = ((x + y) % 2 + x * y % 3) % 2 == 0; break;
|
|
|
|
default: throw std::logic_error("Assertion error");
|
|
|
|
default: throw std::logic_error("Unreachable");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
modules.at(y).at(x) = modules.at(y).at(x) ^ (invert & !isFunction.at(y).at(x));
|
|
|
|
modules.at(y).at(x) = modules.at(y).at(x) ^ (invert & !isFunction.at(y).at(x));
|
|
|
|
}
|
|
|
|
}
|
|
|
|