Updated a few documentation comments.
This commit is contained in:
parent
272ca8bb54
commit
3d4d941da3
|
@ -82,8 +82,8 @@ public final class QrCode {
|
||||||
* Returns a QR Code symbol representing the specified data segments at the specified error correction
|
* Returns a QR Code symbol representing the specified data segments at the specified error correction
|
||||||
* level or higher. The smallest possible QR Code version is automatically chosen for the output.
|
* level or higher. The smallest possible QR Code version is automatically chosen for the output.
|
||||||
* <p>This function allows the user to create a custom sequence of segments that switches
|
* <p>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. This
|
* between modes (such as alphanumeric and binary) to encode text more efficiently.
|
||||||
* function is considered to be lower level than simply encoding text or binary data.</p>
|
* This function is considered to be lower level than simply encoding text or binary data.</p>
|
||||||
* @param segs the segments to encode
|
* @param segs the segments to encode
|
||||||
* @param ecl the error correction level to use (will be boosted)
|
* @param ecl the error correction level to use (will be boosted)
|
||||||
* @return a QR Code representing the segments
|
* @return a QR Code representing the segments
|
||||||
|
|
|
@ -206,6 +206,7 @@ var qrcodegen = new function() {
|
||||||
|
|
||||||
// Based on the given number of border modules to add as padding, this returns a
|
// Based on the given number of border modules to add as padding, this returns a
|
||||||
// string whose contents represents an SVG XML file that depicts this QR Code symbol.
|
// string whose contents represents an SVG XML file that depicts this QR Code symbol.
|
||||||
|
// Note that Unix newlines (\n) are always used, regardless of the platform.
|
||||||
this.toSvgString = function(border) {
|
this.toSvgString = function(border) {
|
||||||
if (border < 0)
|
if (border < 0)
|
||||||
throw "Border must be non-negative";
|
throw "Border must be non-negative";
|
||||||
|
|
|
@ -598,7 +598,7 @@ impl QrCode {
|
||||||
/*---- Private static helper functions ----*/
|
/*---- Private static helper functions ----*/
|
||||||
|
|
||||||
// Returns a set of positions of the alignment patterns in ascending order. These positions are
|
// Returns a set of positions of the alignment patterns in ascending order. These positions are
|
||||||
// used on both the x and y axes. Each value in the resulting array is in the range [0, 177).
|
// used on both the x and y axes. Each value in the resulting list is in the range [0, 177).
|
||||||
// This stateless pure function could be implemented as table of 40 variable-length lists of unsigned bytes.
|
// This stateless pure function could be implemented as table of 40 variable-length lists of unsigned bytes.
|
||||||
fn get_alignment_pattern_positions(ver: u8) -> Vec<i32> {
|
fn get_alignment_pattern_positions(ver: u8) -> Vec<i32> {
|
||||||
assert!(1 <= ver && ver <= 40, "Version number out of range");
|
assert!(1 <= ver && ver <= 40, "Version number out of range");
|
||||||
|
@ -1013,7 +1013,8 @@ impl QrSegmentMode {
|
||||||
|
|
||||||
/*---- Bit buffer functionality ----*/
|
/*---- Bit buffer functionality ----*/
|
||||||
|
|
||||||
// Appends the given number of bits of the given value to this sequence.
|
// Appends the given number of low bits of the given value
|
||||||
|
// to this sequence. Requires 0 <= val < 2^len.
|
||||||
pub fn append_bits(bb: &mut Vec<bool>, val: u32, len: u8) {
|
pub fn append_bits(bb: &mut Vec<bool>, val: u32, len: u8) {
|
||||||
assert!(len < 32 && (val >> len) == 0 || len == 32, "Value out of range");
|
assert!(len < 32 && (val >> len) == 0 || len == 32, "Value out of range");
|
||||||
for i in (0 .. len).rev() { // Append bit by bit
|
for i in (0 .. len).rev() { // Append bit by bit
|
||||||
|
|
Loading…
Reference in New Issue