|
|
|
@ -29,6 +29,7 @@
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "BitBuffer.hpp"
|
|
|
|
|
#include "QrCode.hpp"
|
|
|
|
|
|
|
|
|
|
using std::uint8_t;
|
|
|
|
@ -139,15 +140,19 @@ static void doSegmentDemo() {
|
|
|
|
|
const QrCode qr4 = QrCode::encodeText(madoka, QrCode::Ecc::LOW);
|
|
|
|
|
printQr(qr4);
|
|
|
|
|
|
|
|
|
|
const std::vector<uint8_t> packedKanjiData{ // Kanji mode encoding (13 bits per character)
|
|
|
|
|
0x01, 0xAC, 0x00, 0x9F, 0x80, 0xAE, 0xD5, 0x6B, 0x85, 0x70,
|
|
|
|
|
0x28, 0xE1, 0x29, 0x02, 0xC8, 0x6F, 0x43, 0x1A, 0x18, 0xA0,
|
|
|
|
|
0x1B, 0x05, 0x04, 0x28, 0x80, 0x01, 0x00, 0x00, 0x92, 0x44,
|
|
|
|
|
0x80, 0x24, 0x90, 0x00, 0x04, 0x10, 0x20, 0xA1, 0x13, 0x08,
|
|
|
|
|
0xA8, 0x00, 0x04, 0x10, 0x1F, 0xF0, 0x04, 0x00,
|
|
|
|
|
const std::vector<int> packedKanjiData{ // Kanji mode encoding (13 bits per character)
|
|
|
|
|
0x0035, 0x1002, 0x0FC0, 0x0AED, 0x0AD7,
|
|
|
|
|
0x015C, 0x0147, 0x0129, 0x0059, 0x01BD,
|
|
|
|
|
0x018D, 0x018A, 0x0036, 0x0141, 0x0144,
|
|
|
|
|
0x0001, 0x0000, 0x0249, 0x0240, 0x0249,
|
|
|
|
|
0x0000, 0x0104, 0x0105, 0x0113, 0x0115,
|
|
|
|
|
0x0000, 0x0208, 0x01FF, 0x0008,
|
|
|
|
|
};
|
|
|
|
|
qrcodegen::BitBuffer bb;
|
|
|
|
|
for (int c : packedKanjiData)
|
|
|
|
|
bb.appendBits(c, 13);
|
|
|
|
|
segs.clear();
|
|
|
|
|
segs.push_back(QrSegment(QrSegment::Mode::KANJI, 29, packedKanjiData, 377));
|
|
|
|
|
segs.push_back(QrSegment(QrSegment::Mode::KANJI, packedKanjiData.size(), bb));
|
|
|
|
|
const QrCode qr5 = QrCode::encodeSegments(segs, QrCode::Ecc::LOW);
|
|
|
|
|
printQr(qr5);
|
|
|
|
|
}
|
|
|
|
|