Updated and synchronized QrCode class's top-level documentation comment, in all languages.

This commit is contained in:
Project Nayuki 2018-10-05 21:17:52 +00:00
parent a5b6c28a1f
commit 95e5f14c36
7 changed files with 105 additions and 20 deletions

View File

@ -33,6 +33,22 @@ extern "C" {
#endif
/*
* This library creates QR Code symbols, which is a type of two-dimension barcode.
* Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* A QR Code structure is an immutable square grid of black and white cells.
* The library provides functions to create a QR Code from text or binary data.
* The library covers the QR Code Model 2 specification, supporting all versions (sizes)
* from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
*
* Ways to create a QR Code object:
* - High level: Take the payload data and call qrcodegen_encodeText() or qrcodegen_encodeBinary().
* - Low level: Custom-make the list of segments and call
* qrcodegen_encodeSegments() or qrcodegen_encodeSegmentsAdvanced().
* (Note that all ways require supplying the desired error correction level and various byte buffers.)
*/
/*---- Enum and struct types----*/
/*

View File

@ -32,10 +32,20 @@
namespace qrcodegen {
/*
* Represents an immutable square grid of black and white cells for a QR Code symbol, and
* provides static functions to create a QR Code from user-supplied textual or binary data.
* This class covers the QR Code Model 2 specification, supporting all versions (sizes)
* A QR Code symbol, which is a type of two-dimension barcode.
* Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* Instances of this class represent an immutable square grid of black and white cells.
* The class provides static factory functions to create a QR Code from text or binary data.
* The class covers the QR Code Model 2 specification, supporting all versions (sizes)
* from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
*
* Ways to create a QR Code object:
* - High level: Take the payload data and call QrCode::encodeText() or QrCode::encodeBinary().
* - Mid level: Custom-make the list of segments and call QrCode::encodeSegments().
* - Low level: Custom-make the array of data codeword bytes (including
* segment headers and final padding, excluding error correction codewords),
* supply the appropriate version number, and call the QrCode() constructor.
* (Note that all ways require supplying the desired error correction level.)
*/
class QrCode final {

View File

@ -30,10 +30,24 @@ import java.util.Objects;
/**
* Represents an immutable square grid of black and white cells for a QR Code symbol, and
* provides static functions to create a QR Code from user-supplied textual or binary data.
* <p>This class covers the QR Code Model 2 specification, supporting all versions (sizes)
* A QR Code symbol, which is a type of two-dimension barcode.
* Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* <p>Instances of this class represent an immutable square grid of black and white cells.
* The class provides static factory functions to create a QR Code from text or binary data.
* The class covers the QR Code Model 2 specification, supporting all versions (sizes)
* from 1 to 40, all 4 error correction levels, and 4 character encoding modes.</p>
* <p>Ways to create a QR Code object:</p>
* <ul>
* <li><p>High level: Take the payload data and call {@link QrCode#encodeText(String,Ecc)}
* or {@link QrCode#encodeBinary(byte[],Ecc)}.</p></li>
* <li><p>Mid level: Custom-make the list of {@link QrSegment segments}
* and call {@link QrCode#encodeSegments(List,Ecc)} or
* {@link QrCode#encodeSegments(List,Ecc,int,int,int,boolean)}</p></li>
* <li><p>Low level: Custom-make the array of data codeword bytes (including segment headers and
* final padding, excluding error correction codewords), supply the appropriate version number,
* and call the {@link QrCode#QrCode(int,Ecc,byte[],int) constructor}.</p></li>
* </ul>
* <p>(Note that all ways require supplying the desired error correction level.)</p>
*/
public final class QrCode {

View File

@ -60,10 +60,21 @@ var qrcodegen = new function() {
/*---- QR Code symbol class ----*/
/*
* A class that represents an immutable square grid of black and white cells for a QR Code symbol,
* and provides static functions to create a QR Code from user-supplied textual or binary data.
* This class covers the QR Code Model 2 specification, supporting all versions (sizes)
* A class that represents a QR Code symbol, which is a type of two-dimension barcode.
* Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* Instances of this class represent an immutable square grid of black and white cells.
* The class provides static factory functions to create a QR Code from text or binary data.
* The class covers the QR Code Model 2 specification, supporting all versions (sizes)
* from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
*
* Ways to create a QR Code object:
* - High level: Take the payload data and call QrCode.encodeText() or QrCode.encodeBinary().
* - Mid level: Custom-make the list of segments and call QrCode.encodeSegments().
* - Low level: Custom-make the array of data codeword bytes (including
* segment headers and final padding, excluding error correction codewords),
* supply the appropriate version number, and call the QrCode() constructor.
* (Note that all ways require supplying the desired error correction level.)
*
* This constructor creates a new QR Code with the given version number, error correction level, binary data array,
* and mask number. mask = -1 is for automatic choice, or 0 to 7 for fixed choice. This is a cumbersome low-level constructor
* that should not be invoked directly by the user. To go one level up, see the QrCode.encodeSegments() function.

View File

@ -61,10 +61,20 @@ This module "qrcodegen", public members:
# ---- QR Code symbol class ----
class QrCode(object):
"""Represents an immutable square grid of black and white cells for a QR Code symbol, and
provides static functions to create a QR Code from user-supplied textual or binary data.
This class covers the QR Code Model 2 specification, supporting all versions (sizes)
from 1 to 40, all 4 error correction levels, and 4 character encoding modes."""
"""A QR Code symbol, which is a type of two-dimension barcode.
Invented by Denso Wave and described in the ISO/IEC 18004 standard.
Instances of this class represent an immutable square grid of black and white cells.
The class provides static factory functions to create a QR Code from text or binary data.
The class covers the QR Code Model 2 specification, supporting all versions (sizes)
from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
Ways to create a QR Code object:
- High level: Take the payload data and call QrCode.encode_text() or QrCode.encode_binary().
- Mid level: Custom-make the list of segments and call QrCode.encode_segments().
- Low level: Custom-make the array of data codeword bytes (including
segment headers and final padding, excluding error correction codewords),
supply the appropriate version number, and call the QrCode() constructor.
(Note that all ways require supplying the desired error correction level.)"""
# ---- Static factory functions (high level) ----

View File

@ -24,10 +24,23 @@
/*---- QrCode functionality ----*/
// Represents an immutable square grid of black and white cells for a QR Code symbol, and
// provides static functions to create a QR Code from user-supplied textual or binary data.
// This struct and impl cover the QR Code Model 2 specification, supporting all versions
// (sizes) from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
/*
* A QR Code symbol, which is a type of two-dimension barcode.
* Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* Instances of this struct represent an immutable square grid of black and white cells.
* The impl provides static factory functions to create a QR Code from text or binary data.
* The struct and impl cover the QR Code Model 2 specification, supporting all versions
* (sizes) from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
*
* Ways to create a QR Code object:
* - High level: Take the payload data and call QrCode::encode_text() or QrCode::encode_binary().
* - Mid level: Custom-make the list of segments and call
* QrCode.encode_segments() or QrCode.encode_segments_advanced().
* - Low level: Custom-make the array of data codeword bytes (including segment
* headers and final padding, excluding error correction codewords), supply the
* appropriate version number, and call the QrCode::encode_codewords() constructor.
* (Note that all ways require supplying the desired error correction level.)
*/
#[derive(Clone)]
pub struct QrCode {

View File

@ -34,10 +34,21 @@ namespace qrcodegen {
/*---- QR Code symbol class ----*/
/*
* Represents an immutable square grid of black and white cells for a QR Code symbol, and
* provides static functions to create a QR Code from user-supplied textual or binary data.
* This class covers the QR Code Model 2 specification, supporting all versions (sizes)
* A QR Code symbol, which is a type of two-dimension barcode.
* Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* Instances of this class represent an immutable square grid of black and white cells.
* The class provides static factory functions to create a QR Code from text or binary data.
* The class covers the QR Code Model 2 specification, supporting all versions (sizes)
* from 1 to 40, all 4 error correction levels, and 4 character encoding modes.
*
* Ways to create a QR Code object:
* - High level: Take the payload data and call QrCode.encodeText() or QrCode.encodeBinary().
* - Mid level: Custom-make the list of segments and call QrCode.encodeSegments().
* - Low level: Custom-make the array of data codeword bytes (including
* segment headers and final padding, excluding error correction codewords),
* supply the appropriate version number, and call the QrCode() constructor.
* (Note that all ways require supplying the desired error correction level.)
*
* This constructor creates a new QR Code with the given version number, error correction level, binary data array,
* and mask number. mask = -1 is for automatic choice, or 0 to 7 for fixed choice. This is a cumbersome low-level constructor
* that should not be invoked directly by the user. To go one level up, see the QrCode.encodeSegments() function.