Lines Matching defs:qr
8 * https://www.nayuki.io/page/qr-code-generator-library
47 static std::string toSvgString(const QrCode &qr, int border);
48 static void printQr(const QrCode &qr);
70 const QrCode qr = QrCode::encodeText(text, errCorLvl);
71 printQr(qr);
72 std::cout << toSvgString(qr, 4) << std::endl;
194 static std::string toSvgString(const QrCode &qr, int border) {
197 if (border > INT_MAX / 2 || border * 2 > INT_MAX - qr.getSize())
204 sb << (qr.getSize() + border * 2) << " " << (qr.getSize() + border * 2) << "\" stroke=\"none\">\n";
207 for (int y = 0; y < qr.getSize(); y++) {
208 for (int x = 0; x < qr.getSize(); x++) {
209 if (qr.getModule(x, y)) {
223 static void printQr(const QrCode &qr) {
225 for (int y = -border; y < qr.getSize() + border; y++) {
226 for (int x = -border; x < qr.getSize() + border; x++) {
227 std::cout << (qr.getModule(x, y) ? "##" : " ");