diff options
| author | Kentaro Fukuchi <kentaro@fukuchi.org> | 2020-09-29 11:59:18 +0900 |
|---|---|---|
| committer | Kentaro Fukuchi <kentaro@fukuchi.org> | 2020-09-29 11:59:18 +0900 |
| commit | 0db94b7764f4433d3600191ad49daedbdd2ca73b (patch) | |
| tree | d9d878cf5812f42522810439a22f5385902f9ea0 | |
| parent | 06bfbfd48db68e3acaedbc771b5100fa03dfd499 (diff) | |
| download | Project-Tick-0db94b7764f4433d3600191ad49daedbdd2ca73b.tar.gz Project-Tick-0db94b7764f4433d3600191ad49daedbdd2ca73b.zip | |
Added a sample code snippet to the document.
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | qrencode.h | 24 |
2 files changed, 26 insertions, 0 deletions
@@ -2,6 +2,8 @@ [develop] * qrencode.c: - Removed unused code. + * qrencode.h: + - Added a sample code snippet to the document. 2020.09.28 Kentaro Fukuchi <kentaro@fukuchi.org> [hotfix] diff --git a/qrencode.h b/qrencode.h index 1c66f336c4..3460866321 100644 --- a/qrencode.h +++ b/qrencode.h @@ -60,6 +60,27 @@ * In such cases, the input data would be too large to be encoded in a * symbol of the specified version. * + * The following code snippet demonstrates how to use the obtained object: + * + * \code + * QRcode *qrcode; + * + * qrcode = QRcode_encodeString("TEST", 0, QR_ECLEVEL_M, QR_MODE_8, 1); + * if(qrcode == NULL) abort(); + * + * for(int y = 0; y < qrcode->width; y++) { + * for(int x = 0; x < qrcode->width; x++) { + * if(qrcode->data[y * qrcode->width + x] & 1) { + * draw_black_dot(x, y); + * } else { + * draw_white_dot(x, y); + * } + * } + * } + * + * QRcode_free(qrcode); + * \endcode + * * \section structured Structured append * Libqrencode can generate "Structured-appended" symbols that enable to split * a large data set into multiple QR codes. A QR code reader concatenates @@ -371,6 +392,9 @@ extern int QRinput_setFNC1Second(QRinput *input, unsigned char appid); |`------- finder pattern and separator `-------- non-data modules (format, timing, etc.) @endverbatim + * + * See \ref result section for a sample code snippet that shows how to use the + * obtained QRcode object. */ typedef struct { int version; ///< version of the symbol |
