├── LICENSE ├── README.md ├── doc ├── GBT18284-2000 最标准的二维码资料.pdf └── qr code 英文版.pdf ├── release └── 二维码.exe ├── report ├── report-qrcode-design.pdf └── report-qrcode.pdf ├── require ├── 综合题 - 二维码的实现.pdf └── 综合题 - 附件 demo(不需要输入).exe ├── source ├── Format and Version.cpp ├── Mask.cpp ├── Module Placement.cpp ├── Screen output.cpp ├── common.h ├── data code.cpp ├── error correction.cpp ├── funcation.h ├── main.cpp └── strctureData.cpp └── 综合题 - 二维码的实现.pdf /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 BaiJiazm 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QRCode README.md 2 | -------------------------------------------------------------------------------- /doc/GBT18284-2000 最标准的二维码资料.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/doc/GBT18284-2000 最标准的二维码资料.pdf -------------------------------------------------------------------------------- /doc/qr code 英文版.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/doc/qr code 英文版.pdf -------------------------------------------------------------------------------- /release/二维码.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/release/二维码.exe -------------------------------------------------------------------------------- /report/report-qrcode-design.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/report/report-qrcode-design.pdf -------------------------------------------------------------------------------- /report/report-qrcode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/report/report-qrcode.pdf -------------------------------------------------------------------------------- /require/综合题 - 二维码的实现.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/require/综合题 - 二维码的实现.pdf -------------------------------------------------------------------------------- /require/综合题 - 附件 demo(不需要输入).exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/require/综合题 - 附件 demo(不需要输入).exe -------------------------------------------------------------------------------- /source/Format and Version.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/Format and Version.cpp -------------------------------------------------------------------------------- /source/Mask.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/Mask.cpp -------------------------------------------------------------------------------- /source/Module Placement.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/Module Placement.cpp -------------------------------------------------------------------------------- /source/Screen output.cpp: -------------------------------------------------------------------------------- 1 | #include "common.h" 2 | #include "funcation.h" 3 | 4 | typedef BOOL(WINAPI *PROCSETCONSOLEFONT)(HANDLE, DWORD); 5 | 6 | void setcolor(HANDLE hout, const int bg_color, const int fg_color) 7 | { 8 | SetConsoleTextAttribute(hout, bg_color * 16 + fg_color); 9 | } 10 | void setconsolefont(const HANDLE hout, const int font_no) 11 | { 12 | HMODULE hKernel32 = GetModuleHandleA("kernel32"); 13 | PROCSETCONSOLEFONT setConsoleFont = (PROCSETCONSOLEFONT)GetProcAddress(hKernel32, "SetConsoleFont"); 14 | setConsoleFont(hout, font_no); 15 | return; 16 | } 17 | void setconsoleborder(const HANDLE hout, const int cols, const int lines) 18 | { 19 | char cmd[80]; 20 | 21 | system("cls"); 22 | sprintf(cmd, "mode con cols=%d lines=%d", cols, lines); 23 | system(cmd); 24 | 25 | return; 26 | } 27 | 28 | const int NormalBlank = 0; 29 | const int NormalWhite = 15; 30 | const int reservedFg = 9; 31 | const int ZeroFg = 15; 32 | void ScreenOutput(const QRVersion &Q,char(*m)[177]) 33 | { 34 | const HANDLE hout = GetStdHandle(STD_OUTPUT_HANDLE); 35 | const int size = Q.SideSize; 36 | if (Q.Version>6) 37 | setconsolefont(hout, 0); 38 | else 39 | setconsolefont(hout, 1); 40 | 41 | setconsoleborder(hout, 2 * (size + 4), size + 4); 42 | 43 | int i, j; 44 | for (i = -1; i <= size; i++) 45 | { 46 | for (j = -1; j <= size; j++) 47 | { 48 | if (i == -1 || i == size || j == -1 || j == size || m[i][j] == 2 || m[i][j] == 4) 49 | setcolor(hout, NormalWhite, NormalWhite); 50 | else if (m[i][j] == 1 || m[i][j] == 3) 51 | setcolor(hout, NormalBlank, NormalBlank); 52 | else if (m[i][j] == 0) 53 | setcolor(hout, ZeroFg, ZeroFg); 54 | else if (m[i][j] == -1) 55 | setcolor(hout, reservedFg, reservedFg); 56 | cout << " "; 57 | } 58 | cout << endl; 59 | } 60 | } -------------------------------------------------------------------------------- /source/common.h: -------------------------------------------------------------------------------- 1 | #define _CRT_SECURE_NO_WARNINGS 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | 7 | -------------------------------------------------------------------------------- /source/data code.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/data code.cpp -------------------------------------------------------------------------------- /source/error correction.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/error correction.cpp -------------------------------------------------------------------------------- /source/funcation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/funcation.h -------------------------------------------------------------------------------- /source/main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/main.cpp -------------------------------------------------------------------------------- /source/strctureData.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/source/strctureData.cpp -------------------------------------------------------------------------------- /综合题 - 二维码的实现.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/BaiJiazm/QRCode/8f6eba4ac8f342aeb5559ab8d8f02561aa7c0191/综合题 - 二维码的实现.pdf --------------------------------------------------------------------------------