Name |
Date |
Size |
#Lines |
LOC |
||
---|---|---|---|---|---|---|
.. | - | - | ||||
Makefile | D | 12-May-2024 | 2.4 KiB | 85 | 23 | |
QrCodeGeneratorDemo.cpp | D | 12-May-2024 | 9.5 KiB | 233 | 153 | |
Readme.markdown | D | 12-May-2024 | 2.4 KiB | 62 | 44 | |
qrcodegen.cpp | D | 12-May-2024 | 26.7 KiB | 831 | 616 | |
qrcodegen.hpp | D | 12-May-2024 | 20 KiB | 550 | 100 |
Readme.markdown
1QR Code generator library - C++ 2=============================== 3 4 5Introduction 6------------ 7 8This project aims to be the best, clearest QR Code generator library. The primary goals are flexible options and absolute correctness. Secondary goals are compact implementation size and good documentation comments. 9 10Home page with live JavaScript demo, extensive descriptions, and competitor comparisons: https://www.nayuki.io/page/qr-code-generator-library 11 12 13Features 14-------- 15 16Core features: 17 18* Significantly shorter code but more documentation comments compared to competing libraries 19* Supports encoding all 40 versions (sizes) and all 4 error correction levels, as per the QR Code Model 2 standard 20* Output format: Raw modules/pixels of the QR symbol 21* Detects finder-like penalty patterns more accurately than other implementations 22* Encodes numeric and special-alphanumeric text in less space than general text 23* Coded carefully to prevent memory corruption, integer overflow, platform-dependent inconsistencies, and undefined behavior; tested rigorously to confirm safety 24* Open-source code under the permissive MIT License 25 26Manual parameters: 27 28* User can specify minimum and maximum version numbers allowed, then library will automatically choose smallest version in the range that fits the data 29* User can specify mask pattern manually, otherwise library will automatically evaluate all 8 masks and select the optimal one 30* User can specify absolute error correction level, or allow the library to boost it if it doesn't increase the version number 31* User can create a list of data segments manually and add ECI segments 32 33More information about QR Code technology and this library's design can be found on the project home page. 34 35 36Examples 37-------- 38 39```c++ 40#include <string> 41#include <vector> 42#include "QrCode.hpp" 43using namespace qrcodegen; 44 45// Simple operation 46QrCode qr0 = QrCode::encodeText("Hello, world!", QrCode::Ecc::MEDIUM); 47std::string svg = toSvgString(qr0, 4); // See QrCodeGeneratorDemo 48 49// Manual operation 50std::vector<QrSegment> segs = 51 QrSegment::makeSegments("3141592653589793238462643383"); 52QrCode qr1 = QrCode::encodeSegments( 53 segs, QrCode::Ecc::HIGH, 5, 5, 2, false); 54for (int y = 0; y < qr1.getSize(); y++) { 55 for (int x = 0; x < qr1.getSize(); x++) { 56 (... paint qr1.getModule(x, y) ...) 57 } 58} 59``` 60 61More complete set of examples: https://github.com/nayuki/QR-Code-generator/blob/master/cpp/QrCodeGeneratorDemo.cpp . 62