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

pull/39/merge
Project Nayuki 6 years ago
parent a5b6c28a1f
commit 95e5f14c36

@ -33,6 +33,22 @@ extern "C" {
#endif #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----*/ /*---- Enum and struct types----*/
/* /*

@ -32,10 +32,20 @@
namespace qrcodegen { namespace qrcodegen {
/* /*
* Represents an immutable square grid of black and white cells for a QR Code symbol, and * A QR Code symbol, which is a type of two-dimension barcode.
* provides static functions to create a QR Code from user-supplied textual or binary data. * Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* This class covers the QR Code Model 2 specification, supporting all versions (sizes) * 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. * 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 { class QrCode final {

@ -30,10 +30,24 @@ import java.util.Objects;
/** /**
* Represents an immutable square grid of black and white cells for a QR Code symbol, and * A QR Code symbol, which is a type of two-dimension barcode.
* provides static functions to create a QR Code from user-supplied textual or binary data. * Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* <p>This class covers the QR Code Model 2 specification, supporting all versions (sizes) * <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> * 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 { public final class QrCode {

@ -60,10 +60,21 @@ var qrcodegen = new function() {
/*---- QR Code symbol class ----*/ /*---- QR Code symbol class ----*/
/* /*
* A class that represents an immutable square grid of black and white cells for a QR Code symbol, * A class that represents a QR Code symbol, which is a type of two-dimension barcode.
* and provides static functions to create a QR Code from user-supplied textual or binary data. * Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* This class covers the QR Code Model 2 specification, supporting all versions (sizes) * 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. * 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, * 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 * 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. * that should not be invoked directly by the user. To go one level up, see the QrCode.encodeSegments() function.

@ -61,10 +61,20 @@ This module "qrcodegen", public members:
# ---- QR Code symbol class ---- # ---- QR Code symbol class ----
class QrCode(object): class QrCode(object):
"""Represents an immutable square grid of black and white cells for a QR Code symbol, and """A QR Code symbol, which is a type of two-dimension barcode.
provides static functions to create a QR Code from user-supplied textual or binary data. Invented by Denso Wave and described in the ISO/IEC 18004 standard.
This class covers the QR Code Model 2 specification, supporting all versions (sizes) Instances of this class represent an immutable square grid of black and white cells.
from 1 to 40, all 4 error correction levels, and 4 character encoding modes.""" 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) ---- # ---- Static factory functions (high level) ----

@ -24,10 +24,23 @@
/*---- QrCode functionality ----*/ /*---- 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. * A QR Code symbol, which is a type of two-dimension barcode.
// This struct and impl cover the QR Code Model 2 specification, supporting all versions * Invented by Denso Wave and described in the ISO/IEC 18004 standard.
// (sizes) from 1 to 40, all 4 error correction levels, and 4 character encoding modes. * 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)] #[derive(Clone)]
pub struct QrCode { pub struct QrCode {

@ -34,10 +34,21 @@ namespace qrcodegen {
/*---- QR Code symbol class ----*/ /*---- QR Code symbol class ----*/
/* /*
* Represents an immutable square grid of black and white cells for a QR Code symbol, and * A QR Code symbol, which is a type of two-dimension barcode.
* provides static functions to create a QR Code from user-supplied textual or binary data. * Invented by Denso Wave and described in the ISO/IEC 18004 standard.
* This class covers the QR Code Model 2 specification, supporting all versions (sizes) * 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. * 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, * 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 * 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. * that should not be invoked directly by the user. To go one level up, see the QrCode.encodeSegments() function.

Loading…
Cancel
Save