Overview of QRE

Introduction

The QRE library provides applications with functionality to encode QR Code patterns.
Versions 1 through 40 of the QR Code standard are supported.
You can also create "design QR Code patterns", where specified images are embedded in the center of the generated QR Code.
Note: Once an image is passed to a function, control normally does not return to the calling function until processing is complete, regardless of whether it succeeds or fails.

Basic Specifications of the QR Encode Library

This version supports the following QR Code specifications.

QR Code specifications

QR Code versionVersions 1 through 40
ModelsModel 2 only
ModeNumeric mode: 0-9 (ASCII codes 0x30 - 0x39)
Alphanumeric mode: 0-9 (ASCII codes 0x30 - 0x39), A-Z (ASCII codes 0x41 - 0x5A), single-byte space, $, %, *, +, -, /, : symbols (ASCII codes 0x20, 0x24, 0x25, 0x2A, 0x2B, 0x2D to 0x2F, 0x3A)
Kanji mode: Shift_JIS kanji based on JIS X 0208. 8-bit byte mode: Data based on JIS X 0201 (ASCII codes 0x00 to 0xFF). This mode includes the lowercase letters a-z (ASCII values 0x61 - 0x7A).
Mixed mode: Data that is a combination of these four modes.
Concatenate mode: Data split into multiple QR Code patterns. No support for FNC1 mode or ECI mode.
Error correction capabilityL, M, H, Q (The recommended level is M for normal QR Code and H for design QR Code.)

Notes for Planning

Note the following points when you use this library.

To display on the screen of Nintendo 3DS series: 2 dots or more per cell is recommended (to read using the camera in the Nintendo 3DS series).
3 dots or more per cell is recommended (to read using the camera in the GamePad).
To print the encoded image: Use the 0.45mm/cell or larger when reading with the camera in the Nintendo 3DS family.
Use the 0.50mm/cell or larger when reading with the camera on the GamePad.
Either way, the maximum version values are as follows.
  • Error correction level L: 15
  • Error correction level M: 17
  • Error correction level Q: 21
  • Error correction level H: 25

Using the Library

The general procedure for encoding QR Code patterns is described below.

1. Pass the data to be encoded to the GetEncodeBufferSize function to obtain the size of the buffer needed for encoding.
2. Instantiate an object of the QREncoder class on the application side, allocate a work buffer of the size obtained in Step 1, and pass the address of that buffer to the InitMemory function to prepare for encoding.
3. Perform encoding by either the Encode function or the EncodeWithImage function.
4. Display the QR Code appropriately based on the encoding results that are obtained (from the GetDivCount, GetQRSize and GetQRData functions).
5. Release the QREncoder class instance and deallocate the work buffer secured in Step 2.

It is possible to divide up and store a single set of data in as many as 16 QR Code patterns. The QRE library supports these concatenated QR Code patterns.
If the target QR Code is a set of concatenated QR Code patterns, use the GetDivCount function to get the number of QR Code patterns in the divided set, and use the GetQRData function to get that number of QR Code patterns.


When the original complete set of data is divided among QR Code patterns, it is broken up in a logical way. If double-byte characters (for example, kanji or hiragana) are contained in the data, the kanji are divided up into units of 2 bytes. In other words, double-byte characters are not divided in half.

This example shows an original complete piece of data divided over several QR Code patterns. They store "abcdefg日本."
Data Divided into Four QR Code patterns
ab cde fg 日本

For more information, see the sample demos.

Generating Design QR Code Patterns

This library can position an optional image in the center of the created QR Code.
To create a design QR Code of this type, pass the image you want to use to the EncodeWithImage function and then run the encoder.
After that, the procedure is the same as for creating a regular QR Code.

Other

This library is not thread-safe, so it may not operate normally when functions are called from an interrupt handler or a different thread.

Revision History

2015-03-25
Added Notes for Planning.
2010-06-24
Corrected the text.
2010-05-31
Initial version.

CONFIDENTIAL