mirror of
https://github.com/status-im/QR-Code-generator.git
synced 2026-08-31 01:31:10 +00:00
Reduced the use of the word "symbol" when referring to QR Codes, in all languages.
This commit is contained in:
+13
-13
@@ -64,7 +64,7 @@ var qrcodegen = new function() {
|
||||
* 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.
|
||||
* This constructor creates a new QR Code symbol 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
|
||||
* that should not be invoked directly by the user. To go one level up, see the QrCode.encodeSegments() function.
|
||||
*/
|
||||
@@ -121,17 +121,17 @@ var qrcodegen = new function() {
|
||||
|
||||
/*---- Read-only instance properties ----*/
|
||||
|
||||
// This QR Code symbol's version number, which is always between 1 and 40 (inclusive).
|
||||
// This QR Code's version number, which is always between 1 and 40 (inclusive).
|
||||
Object.defineProperty(this, "version", {value:version});
|
||||
|
||||
// The width and height of this QR Code symbol, measured in modules.
|
||||
// The width and height of this QR Code, measured in modules.
|
||||
// Always equal to version * 4 + 17, in the range 21 to 177.
|
||||
Object.defineProperty(this, "size", {value:size});
|
||||
|
||||
// The error correction level used in this QR Code symbol.
|
||||
// The error correction level used in this QR Code.
|
||||
Object.defineProperty(this, "errorCorrectionLevel", {value:errCorLvl});
|
||||
|
||||
// The mask pattern used in this QR Code symbol, in the range 0 to 7 (i.e. unsigned 3-bit integer).
|
||||
// The mask pattern used in this QR Code, in the range 0 to 7 (i.e. unsigned 3-bit integer).
|
||||
// Note that even if the constructor was called with automatic masking requested
|
||||
// (mask = -1), the resulting object will still have a mask value between 0 and 7.
|
||||
Object.defineProperty(this, "mask", {value:mask});
|
||||
@@ -149,7 +149,7 @@ var qrcodegen = new function() {
|
||||
|
||||
/*---- Public instance methods ----*/
|
||||
|
||||
// Draws this QR Code symbol with the given module scale and number of modules onto the given HTML canvas element.
|
||||
// Draws this QR Code with the given module scale and number of modules onto the given HTML canvas element.
|
||||
// The canvas will be resized to a width and height of (this.size + border * 2) * scale. The painted image will be purely
|
||||
// black and white with no transparent regions. The scale must be a positive integer, and the border must be a non-negative integer.
|
||||
this.drawCanvas = function(scale, border, canvas) {
|
||||
@@ -167,7 +167,7 @@ var qrcodegen = new function() {
|
||||
}
|
||||
};
|
||||
|
||||
// Returns a string of SVG XML code representing an image of this QR Code symbol with the given
|
||||
// Returns a string of SVG XML code representing an image of this QR Code with the given
|
||||
// number of border modules. Note that Unix newlines (\n) are always used, regardless of the platform.
|
||||
this.toSvgString = function(border) {
|
||||
if (border < 0)
|
||||
@@ -351,7 +351,7 @@ var qrcodegen = new function() {
|
||||
|
||||
|
||||
// Draws the given sequence of 8-bit codewords (data and error correction) onto the entire
|
||||
// data area of this QR Code symbol. Function modules need to be marked off before this is called.
|
||||
// data area of this QR Code. Function modules need to be marked off before this is called.
|
||||
function drawCodewords(data) {
|
||||
if (data.length != Math.floor(QrCode.getNumRawDataModules(version) / 8))
|
||||
throw "Invalid argument";
|
||||
@@ -383,7 +383,7 @@ var qrcodegen = new function() {
|
||||
// The function modules must be marked and the codeword bits must be drawn
|
||||
// before masking. Due to the arithmetic of XOR, calling applyMask() with
|
||||
// the same mask value a second time will undo the mask. A final well-formed
|
||||
// QR Code symbol needs exactly one (not zero, two, etc.) mask applied.
|
||||
// QR Code needs exactly one (not zero, two, etc.) mask applied.
|
||||
function applyMask(mask) {
|
||||
if (mask < 0 || mask > 7)
|
||||
throw "Mask value out of range";
|
||||
@@ -516,7 +516,7 @@ var qrcodegen = new function() {
|
||||
/*---- Static factory functions (high level) for QrCode ----*/
|
||||
|
||||
/*
|
||||
* Returns a QR Code symbol representing the given Unicode text string at the given error correction level.
|
||||
* Returns a QR Code representing the given Unicode text string at the given error correction level.
|
||||
* As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer
|
||||
* Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible
|
||||
* QR Code version is automatically chosen for the output. The ECC level of the result may be higher than the
|
||||
@@ -529,7 +529,7 @@ var qrcodegen = new function() {
|
||||
|
||||
|
||||
/*
|
||||
* Returns a QR Code symbol representing the given binary data string at the given error correction level.
|
||||
* Returns a QR Code representing the given binary data string at the given error correction level.
|
||||
* This function always encodes using the binary segment mode, not any text mode. The maximum number of
|
||||
* bytes allowed is 2953. The smallest possible QR Code version is automatically chosen for the output.
|
||||
* The ECC level of the result may be higher than the ecl argument if it can be done without increasing the version.
|
||||
@@ -543,7 +543,7 @@ var qrcodegen = new function() {
|
||||
/*---- Static factory functions (mid level) for QrCode ----*/
|
||||
|
||||
/*
|
||||
* Returns a QR Code symbol representing the given segments with the given encoding parameters.
|
||||
* Returns a QR Code representing the given segments with the given encoding parameters.
|
||||
* The smallest possible QR Code version within the given range is automatically chosen for the output.
|
||||
* This function allows the user to create a custom sequence of segments that switches
|
||||
* between modes (such as alphanumeric and binary) to encode text more efficiently.
|
||||
@@ -599,7 +599,7 @@ var qrcodegen = new function() {
|
||||
for (var padByte = 0xEC; bb.length < dataCapacityBits; padByte ^= 0xEC ^ 0x11)
|
||||
bb.appendBits(padByte, 8);
|
||||
|
||||
// Create the QR Code symbol
|
||||
// Create the QR Code object
|
||||
return new this(version, ecl, bb.getBytes(), mask);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user