Update support for QR version 7 to 9

This commit is contained in:
Merricx 2018-05-11 03:30:12 +07:00
parent a521c5b30a
commit ce2de974bd
23 changed files with 3297 additions and 2815 deletions

View file

@ -89,7 +89,7 @@
</div>
<div class="clear"></div>
<h5>Module Size :</h5>
<input id="qr-size" type="text" readonly value="15px">
<input id="qr-size" type="text" readonly value="10px">
<div class="toolbox">
<div id="btn-size-min" class="minus"><img src="img/minus.png"></div>
<div id="btn-size-plus" class="plus"><img src="img/plus.png"></div>
@ -329,7 +329,7 @@
<h3>QR Decoder</h3>
<div class="space"></div>
<h5>Decoded Message : </h5>
<input id="decode-message" type="text" readonly>
<textarea id="decode-message" spellcheck="false" style="width: 100%; margin: 0;" readonly></textarea>
<div class="clear"></div>
<div id="div-decode-error" class="hide">
<h5>Error : </h5>

View file

@ -30,32 +30,22 @@ function AlignmentPattern(posX, posY, estimatedModuleSize)
this.count = 1;
this.estimatedModuleSize = estimatedModuleSize;
Object.defineProperties(this, {
'EstimatedModuleSize': {
get: function () {
this.__defineGetter__("EstimatedModuleSize", function()
{
return this.estimatedModuleSize;
}
},
"Count": {
get: function() {
return this.count;
}
},
"X": {
get: function() {
return Math.floor(this.x);
}
},
"Y": {
get: function() {
return Math.floor(this.y);
}
}
});
this.__defineGetter__("Count", function()
{
return this.count;
});
this.__defineGetter__("X", function()
{
return Math.floor(this.x);
});
this.__defineGetter__("Y", function()
{
return Math.floor(this.y);
});
this.incrementCount = function()
{
this.count++;

View file

@ -34,38 +34,30 @@ function BitMatrix( width, height)
this.width = width;
this.height = height;
var rowSize = width >> 5;
if ((width & 0x1f) != 0) {
if ((width & 0x1f) != 0)
{
rowSize++;
}
this.rowSize = rowSize;
this.bits = new Array(rowSize * height);
for(var i=0;i<this.bits.length;i++)
this.bits[i]=0;
Object.defineProperties(this, {
'Width': {
get: function () {
this.__defineGetter__("Width", function()
{
return this.width;
}
},
'Height': {
get: function () {
});
this.__defineGetter__("Height", function()
{
return this.height;
}
},
'Dimension': {
get: function () {
if (this.width != this.height) {
});
this.__defineGetter__("Dimension", function()
{
if (this.width != this.height)
{
throw "Can't call getDimension() on a non-square matrix";
}
return this.width;
}
}
});
this.get_Renamed=function( x, y)

View file

@ -28,18 +28,13 @@ function DataBlock(numDataCodewords, codewords)
this.numDataCodewords = numDataCodewords;
this.codewords = codewords;
Object.defineProperties(this, {
'NumDataCodewords': {
get: function () {
this.__defineGetter__("NumDataCodewords", function()
{
return this.numDataCodewords;
}
},
'Codewords': {
get: function () {
});
this.__defineGetter__("Codewords", function()
{
return this.codewords;
}
}
});
}

View file

@ -23,7 +23,8 @@
*/
function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
function QRCodeDataBlockReader(blocks, version, numErrorCorrectionCode)
{
this.blockPointer = 0;
this.bitPointer = 7;
this.dataLength = 0;
@ -36,13 +37,15 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
else if (version >= 27 && version <= 40)
this.dataLengthMode = 2;
this.getNextBits = function (numBits) {
this.getNextBits = function( numBits)
{
var bits = 0;
if (numBits < this.bitPointer + 1) {
if (numBits < this.bitPointer + 1)
{
// next word fits into current data block
var mask = 0;
for (var i = 0; i < numBits; i++) {
for (var i = 0; i < numBits; i++)
{
mask += (1 << i);
}
mask <<= (this.bitPointer - numBits + 1);
@ -50,7 +53,9 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
bits = (this.blocks[this.blockPointer] & mask) >> (this.bitPointer - numBits + 1);
this.bitPointer -= numBits;
return bits;
} else if (numBits < this.bitPointer + 1 + 8) {
}
else if (numBits < this.bitPointer + 1 + 8)
{
// next word crosses 2 data blocks
var mask1 = 0;
for (var i = 0; i < this.bitPointer + 1; i++)
@ -67,7 +72,9 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
this.bitPointer = 8 + this.bitPointer;
}
return bits;
} else if (numBits < this.bitPointer + 1 + 16) {
}
else if (numBits < this.bitPointer + 1 + 16)
{
// next word crosses 3 data blocks
var mask1 = 0; // mask of first block
var mask3 = 0; // mask of 3rd block
@ -84,33 +91,35 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
var bitsSecondBlock = this.blocks[this.blockPointer] << (numBits - (this.bitPointer + 1 + 8));
this.blockPointer++;
for (var i = 0; i < numBits - (this.bitPointer + 1 + 8); i++) {
for (var i = 0; i < numBits - (this.bitPointer + 1 + 8); i++)
{
mask3 += (1 << i);
}
mask3 <<= 8 - (numBits - (this.bitPointer + 1 + 8));
var bitsThirdBlock = (this.blocks[this.blockPointer] & mask3) >> (8 - (numBits - (this.bitPointer + 1 + 8)));
bits = bitsFirstBlock + bitsSecondBlock + bitsThirdBlock;
this.bitPointer = this.bitPointer - (numBits - 8) % 8;
if (this.bitPointer < 0) {
if (this.bitPointer < 0)
{
this.bitPointer = 8 + this.bitPointer;
}
return bits;
} else {
}
else
{
return 0;
}
};
this.NextMode = function () {
}
this.NextMode=function()
{
if ((this.blockPointer > this.blocks.length - this.numErrorCorrectionCode - 2))
return 0;
else
return this.getNextBits(4);
};
this.getDataLength=function( modeIndicator) {
}
this.getDataLength=function( modeIndicator)
{
var index = 0;
while (true)
{
@ -120,33 +129,37 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
}
return this.getNextBits(qrcode.sizeOfDataLengthInfo[this.dataLengthMode][index]);
};
this.getRomanAndFigureString = function (dataLength) {
}
this.getRomanAndFigureString=function( dataLength)
{
var length = dataLength;
var intData = 0;
var strData = "";
var tableRomanAndFigure = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', '$', '%', '*', '+', '-', '.', '/', ':');
do {
if (length > 1) {
do
{
if (length > 1)
{
intData = this.getNextBits(11);
var firstLetter = Math.floor(intData / 45);
var secondLetter = intData % 45;
strData += tableRomanAndFigure[firstLetter];
strData += tableRomanAndFigure[secondLetter];
length -= 2;
} else if (length == 1) {
}
else if (length == 1)
{
intData = this.getNextBits(6);
strData += tableRomanAndFigure[intData];
length -= 1;
}
} while (length > 0);
}
while (length > 0);
return strData;
};
this.getFigureString=function( dataLength) {
}
this.getFigureString=function( dataLength)
{
var length = dataLength;
var intData = 0;
var strData = "";
@ -178,78 +191,118 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
while (length > 0);
return strData;
};
this.get8bitByteArray=function( dataLength) {
}
this.get8bitByteArray=function( dataLength)
{
var length = dataLength;
var intData = 0;
var output = new Array();
do {
do
{
intData = this.getNextBits(8);
output.push( intData);
length--;
} while (length > 0);
}
while (length > 0);
return output;
};
this.getKanjiString = function (dataLength) {
}
this.getKanjiString=function( dataLength)
{
var length = dataLength;
var intData = 0;
var unicodeString = "";
do {
intData = getNextBits(13);
do
{
intData = this.getNextBits(13);
var lowerByte = intData % 0xC0;
var higherByte = intData / 0xC0;
var tempWord = (higherByte << 8) + lowerByte;
var shiftjisWord = 0;
if (tempWord + 0x8140 <= 0x9FFC) {
if (tempWord + 0x8140 <= 0x9FFC)
{
// between 8140 - 9FFC on Shift_JIS character set
shiftjisWord = tempWord + 0x8140;
} else {
}
else
{
// between E040 - EBBF on Shift_JIS character set
shiftjisWord = tempWord + 0xC140;
}
//var tempByte = new Array(0,0);
//tempByte[0] = (sbyte) (shiftjisWord >> 8);
//tempByte[1] = (sbyte) (shiftjisWord & 0xFF);
//unicodeString += new String(SystemUtils.ToCharArray(SystemUtils.ToByteArray(tempByte)));
unicodeString += String.fromCharCode(shiftjisWord);
length--;
} while (length > 0);
}
while (length > 0);
return unicodeString;
};
}
Object.defineProperty(this, 'DataByte', {
get: function () {
this.parseECIValue = function ()
{
var intData = 0;
var firstByte = this.getNextBits(8);
if ((firstByte & 0x80) == 0) {
intData = firstByte & 0x7F;
}
if ((firstByte & 0xC0) == 0x80) {
// two bytes
var secondByte = this.getNextBits(8);
intData = ((firstByte & 0x3F) << 8) | secondByte;
}
if ((firstByte & 0xE0) == 0xC0) {
// three bytes
var secondThirdBytes = this.getNextBits(8);;
intData = ((firstByte & 0x1F) << 16) | secondThirdBytes;
}
return intData;
}
this.__defineGetter__("DataByte", function()
{
var output = new Array();
var MODE_NUMBER = 1;
var MODE_ROMAN_AND_NUMBER = 2;
var MODE_8BIT_BYTE = 4;
var MODE_ECI = 7;
var MODE_KANJI = 8;
do {
do
{
var mode = this.NextMode();
if (mode == 0) {
console.log(mode);
//canvas.println("mode: " + mode);
if (mode == 0)
{
if (output.length > 0)
break;
else
throw "Empty data block";
}
if (mode != MODE_NUMBER &&
mode != MODE_ROMAN_AND_NUMBER &&
mode != MODE_8BIT_BYTE &&
mode != MODE_KANJI) {
mode = guessMode(mode);
if (mode != MODE_NUMBER && mode != MODE_ROMAN_AND_NUMBER && mode != MODE_8BIT_BYTE && mode != MODE_KANJI && mode != MODE_ECI)
{
throw "Invalid mode: " + mode + " in (block:" + this.blockPointer + " bit:" + this.bitPointer + ")";
}
dataLength = this.getDataLength(mode);
if(mode == MODE_ECI)
{
var temp_sbyteArray3 = this.parseECIValue();
//output.push(temp_sbyteArray3);
}
else
{
var dataLength = this.getDataLength(mode);
if (dataLength < 1)
throw "Invalid data length: " + dataLength;
switch (mode) {
switch (mode)
{
case MODE_NUMBER:
var temp_str = this.getFigureString(dataLength);
var ta = new Array(temp_str.length);
@ -276,9 +329,9 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
output.push(temp_str);
break;
}
} while (true);
return output;
}
}
while (true);
return output;
});
}

View file

@ -23,7 +23,7 @@
*/
DataMask = {};
var DataMask = {};
DataMask.forReference = function(reference)
{

View file

@ -23,7 +23,7 @@
*/
Decoder={};
var Decoder={};
Decoder.rsDecoder = new ReedSolomonDecoder(GF256.QR_CODE_FIELD);
Decoder.correctErrors=function( codewordBytes, numDataCodewords)
@ -56,7 +56,7 @@ Decoder.correctErrors=function( codewordBytes, numDataCodewords)
Decoder.decode=function(bits)
{
var parser = new BitMatrixParser(bits);console.log(JSON.stringify(bits));
var parser = new BitMatrixParser(bits);
var version = parser.readVersion();
var ecLevel = parser.readFormatInformation().ErrorCorrectionLevel;

View file

@ -90,21 +90,21 @@ PerspectiveTransform.quadrilateralToQuadrilateral=function( x0, y0, x1, y1,
PerspectiveTransform.squareToQuadrilateral=function( x0, y0, x1, y1, x2, y2, x3, y3)
{
dy2 = y3 - y2;
dy3 = y0 - y1 + y2 - y3;
var dy2 = y3 - y2;
var dy3 = y0 - y1 + y2 - y3;
if (dy2 == 0.0 && dy3 == 0.0)
{
return new PerspectiveTransform(x1 - x0, x2 - x1, x0, y1 - y0, y2 - y1, y0, 0.0, 0.0, 1.0);
}
else
{
dx1 = x1 - x2;
dx2 = x3 - x2;
dx3 = x0 - x1 + x2 - x3;
dy1 = y1 - y2;
denominator = dx1 * dy2 - dx2 * dy1;
a13 = (dx3 * dy2 - dx2 * dy3) / denominator;
a23 = (dx1 * dy3 - dx3 * dy1) / denominator;
var dx1 = x1 - x2;
var dx2 = x3 - x2;
var dx3 = x0 - x1 + x2 - x3;
var dy1 = y1 - y2;
var denominator = dx1 * dy2 - dx2 * dy1;
var a13 = (dx3 * dy2 - dx2 * dy3) / denominator;
var a23 = (dx1 * dy3 - dx3 * dy1) / denominator;
return new PerspectiveTransform(x1 - x0 + a13 * x1, x3 - x0 + a23 * x3, x0, y1 - y0 + a13 * y1, y3 - y0 + a23 * y3, y0, a13, a23, 1.0);
}
}
@ -258,8 +258,8 @@ function Detector(image)
this.distance=function( pattern1, pattern2)
{
xDiff = pattern1.X - pattern2.X;
yDiff = pattern1.Y - pattern2.Y;
var xDiff = pattern1.X - pattern2.X;
var yDiff = pattern1.Y - pattern2.Y;
return Math.sqrt( (xDiff * xDiff + yDiff * yDiff));
}
this.computeDimension=function( topLeft, topRight, bottomLeft, moduleSize)

View file

@ -28,32 +28,26 @@ function ErrorCorrectionLevel(ordinal, bits, name)
this.ordinal_Renamed_Field = ordinal;
this.bits = bits;
this.name = name;
Object.defineProperties(this, {
'Bits': {
get: function () {
this.__defineGetter__("Bits", function()
{
return this.bits;
}
},
'Name': {
get: function () {
return this.name;
}
}
});
this.ordinal=function() {
this.__defineGetter__("Name", function()
{
return this.name;
});
this.ordinal=function()
{
return this.ordinal_Renamed_Field;
}
}
ErrorCorrectionLevel.forBits=function( bits)
{
if (bits < 0 || bits >= FOR_BITS.length) {
if (bits < 0 || bits >= FOR_BITS.length)
{
throw "ArgumentException";
}
return FOR_BITS[bits];
}

View file

@ -28,20 +28,25 @@ var MAX_MODULES = 57;
var INTEGER_MATH_SHIFT = 8;
var CENTER_QUORUM = 2;
qrcode.orderBestPatterns = function (patterns) {
function distance( pattern1, pattern2) {
xDiff = pattern1.X - pattern2.X;
yDiff = pattern1.Y - pattern2.Y;
qrcode.orderBestPatterns=function(patterns)
{
function distance( pattern1, pattern2)
{
var xDiff = pattern1.X - pattern2.X;
var yDiff = pattern1.Y - pattern2.Y;
return Math.sqrt( (xDiff * xDiff + yDiff * yDiff));
}
/// <summary> Returns the z component of the cross product between vectors BC and BA.</summary>
function crossProductZ( pointA, pointB, pointC) {
function crossProductZ( pointA, pointB, pointC)
{
var bX = pointB.x;
var bY = pointB.y;
return ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX));
}
// Find distances between pattern centers
var zeroOneDistance = distance(patterns[0], patterns[1]);
var oneTwoDistance = distance(patterns[1], patterns[2]);
@ -49,15 +54,20 @@ qrcode.orderBestPatterns = function (patterns) {
var pointA, pointB, pointC;
// Assume one closest to other two is B; A and C will just be guesses at first
if (oneTwoDistance >= zeroOneDistance && oneTwoDistance >= zeroTwoDistance) {
if (oneTwoDistance >= zeroOneDistance && oneTwoDistance >= zeroTwoDistance)
{
pointB = patterns[0];
pointA = patterns[1];
pointC = patterns[2];
} else if (zeroTwoDistance >= oneTwoDistance && zeroTwoDistance >= zeroOneDistance) {
}
else if (zeroTwoDistance >= oneTwoDistance && zeroTwoDistance >= zeroOneDistance)
{
pointB = patterns[1];
pointA = patterns[0];
pointC = patterns[2];
} else {
}
else
{
pointB = patterns[2];
pointA = patterns[0];
pointC = patterns[1];
@ -67,9 +77,9 @@ qrcode.orderBestPatterns = function (patterns) {
// This asks whether BC x BA has a positive z component, which is the arrangement
// we want for A, B, C. If it's negative, then we've got it flipped around and
// should swap A and C.
if (crossProductZ(pointA, pointB, pointC) < 0.0) {
if (crossProductZ(pointA, pointB, pointC) < 0.0)
{
var temp = pointA;
pointA = pointC;
pointC = temp;
}
@ -77,76 +87,64 @@ qrcode.orderBestPatterns = function (patterns) {
patterns[0] = pointA;
patterns[1] = pointB;
patterns[2] = pointC;
};
}
function FinderPattern (posX, posY, estimatedModuleSize) {
function FinderPattern(posX, posY, estimatedModuleSize)
{
this.x=posX;
this.y=posY;
this.count = 1;
this.estimatedModuleSize = estimatedModuleSize;
Object.defineProperties(this, {
"EstimatedModuleSize": {
get: function () {
this.__defineGetter__("EstimatedModuleSize", function()
{
return this.estimatedModuleSize;
}
},
"Count": {
get: function () {
return this.count;
}
},
"X": {
get: function () {
return this.x;
}
},
"Y": {
get: function () {
return this.y;
}
}
});
this.incrementCount = function() {
this.__defineGetter__("Count", function()
{
return this.count;
});
this.__defineGetter__("X", function()
{
return this.x;
});
this.__defineGetter__("Y", function()
{
return this.y;
});
this.incrementCount = function()
{
this.count++;
};
this.aboutEquals = function (moduleSize, i, j) {
if (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize) {
}
this.aboutEquals=function( moduleSize, i, j)
{
if (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)
{
var moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);
return moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;
}
return false;
}
};
function FinderPatternInfo(patternCenters) {
}
function FinderPatternInfo(patternCenters)
{
this.bottomLeft = patternCenters[0];
this.topLeft = patternCenters[1];
this.topRight = patternCenters[2];
Object.defineProperties(this, {
"BottomLeft": {
get: function () {
this.__defineGetter__("BottomLeft", function()
{
return this.bottomLeft;
}
},
"TopLeft": {
get: function () {
});
this.__defineGetter__("TopLeft", function()
{
return this.topLeft;
}
},
"TopRight": {
get: function () {
});
this.__defineGetter__("TopRight", function()
{
return this.topRight;
}
}
});
}
@ -158,16 +156,14 @@ function FinderPatternFinder()
this.crossCheckStateCount = new Array(0,0,0,0,0);
this.resultPointCallback = null;
Object.defineProperty(this, 'CrossCheckStateCount', {
get: function () {
this.__defineGetter__("CrossCheckStateCount", function()
{
this.crossCheckStateCount[0] = 0;
this.crossCheckStateCount[1] = 0;
this.crossCheckStateCount[2] = 0;
this.crossCheckStateCount[3] = 0;
this.crossCheckStateCount[4] = 0;
return this.crossCheckStateCount;
}
});
this.foundPatternCross=function( stateCount)
@ -395,7 +391,7 @@ function FinderPatternFinder()
if (startSize < 3)
{
// Couldn't find enough finder patterns
throw "Couldn't find enough finder patterns";
throw "Couldn't find enough finder patterns (found " + startSize + ")"
}
// Filter outlier possibilities whose module size is too different
@ -426,14 +422,16 @@ function FinderPatternFinder()
var stdDev = Math.sqrt(square / startSize - average * average);
var limit = Math.max(0.2 * average, stdDev);
for (var i = 0; i < this.possibleCenters.length && this.possibleCenters.length > 3; i++)
//for (var i = 0; i < this.possibleCenters.length && this.possibleCenters.length > 3; i++)
for (var i = this.possibleCenters.length - 1; i >= 0 ; i--)
{
var pattern = this.possibleCenters[i];
//if (Math.abs(pattern.EstimatedModuleSize - average) > 0.2 * average)
if (Math.abs(pattern.EstimatedModuleSize - average) > limit)
{
this.possibleCenters.remove(i);
i--;
//this.possibleCenters.remove(i);
this.possibleCenters.splice(i,1);
//i--;
}
}
}
@ -639,7 +637,7 @@ function FinderPatternFinder()
if (this.hasSkipped)
{
// Found a third one
done = haveMultiplyConfirmedCenters();
done = this.haveMultiplyConfirmedCenters();
}
}
}

View file

@ -33,23 +33,17 @@ function FormatInformation(formatInfo)
this.errorCorrectionLevel = ErrorCorrectionLevel.forBits((formatInfo >> 3) & 0x03);
this.dataMask = (formatInfo & 0x07);
Object.defineProperties(this, {
'ErrorCorrectionLevel': {
get: function () {
this.__defineGetter__("ErrorCorrectionLevel", function()
{
return this.errorCorrectionLevel;
}
},
'DataMask': {
get: function () {
return this.dataMask;
}
}
});
this.__defineGetter__("DataMask", function()
{
return this.dataMask;
});
this.GetHashCode=function()
{
return (this.errorCorrectionLevel.ordinal() << 3) | dataMask;
return (this.errorCorrectionLevel.ordinal() << 3) | this.dataMask;
}
this.Equals=function( o)
{

View file

@ -47,20 +47,14 @@ function GF256( primitive)
var at1=new Array(1);at1[0]=1;
this.one = new GF256Poly(this, new Array(at1));
Object.defineProperties(this, {
'Zero': {
get: function () {
this.__defineGetter__("Zero", function()
{
return this.zero;
}
},
'One': {
get: function () {
return this.one;
}
}
});
this.__defineGetter__("One", function()
{
return this.one;
});
this.buildMonomial=function( degree, coefficient)
{
if (degree < 0)
@ -69,7 +63,7 @@ function GF256( primitive)
}
if (coefficient == 0)
{
return zero;
return this.zero;
}
var coefficients = new Array(degree + 1);
for(var i=0;i<coefficients.length;i++)coefficients[i]=0;

View file

@ -56,24 +56,17 @@ function GF256Poly(field, coefficients)
this.coefficients = coefficients;
}
Object.defineProperties(this, {
"Zero": {
get: function () {
this.__defineGetter__("Zero", function()
{
return this.coefficients[0] == 0;
}
},
"Degree": {
get: function () {
});
this.__defineGetter__("Degree", function()
{
return this.coefficients.length - 1;
}
},
"Coefficients": {
get: function () {
});
this.__defineGetter__("Coefficients", function()
{
return this.coefficients;
}
}
});
this.getCoefficient=function( degree)

View file

@ -23,7 +23,7 @@
*/
GridSampler = {};
var GridSampler = {};
GridSampler.checkAndNudgePoints=function( image, points)
{
@ -118,12 +118,12 @@ GridSampler.sampleGrid3=function( image, dimension, transform)
{
for (var x = 0; x < max; x += 2)
{
var xpoint = (Math.floor( points[x]) * 4) + (Math.floor( points[x + 1]) * qrcode.width * 4);
//var xpoint = (Math.floor( points[x]) * 4) + (Math.floor( points[x + 1]) * qrcode.width * 4);
var bit = image[Math.floor( points[x])+ qrcode.width* Math.floor( points[x + 1])];
qrcode.imagedata.data[xpoint] = bit?255:0;
qrcode.imagedata.data[xpoint+1] = bit?255:0;
qrcode.imagedata.data[xpoint+2] = 0;
qrcode.imagedata.data[xpoint+3] = 255;
//qrcode.imagedata.data[xpoint] = bit?255:0;
//qrcode.imagedata.data[xpoint+1] = bit?255:0;
//qrcode.imagedata.data[xpoint+2] = 0;
//qrcode.imagedata.data[xpoint+3] = 255;
//bits[x >> 1][ y]=bit;
if(bit)
bits.set_Renamed(x >> 1, y);

View file

@ -15,7 +15,7 @@
*/
qrcode = {};
var qrcode = {};
qrcode.imagedata = null;
qrcode.width = 0;
qrcode.height = 0;
@ -27,12 +27,129 @@ qrcode.sizeOfDataLengthInfo = [ [ 10, 9, 8, 8 ], [ 12, 11, 16, 10 ], [ 14, 1
qrcode.callback = null;
qrcode.vidSuccess = function (stream)
{
qrcode.localstream = stream;
if(qrcode.webkit)
qrcode.video.src = window.webkitURL.createObjectURL(stream);
else
if(qrcode.moz)
{
qrcode.video.mozSrcObject = stream;
qrcode.video.play();
}
else
qrcode.video.src = stream;
qrcode.gUM=true;
qrcode.canvas_qr2 = document.createElement('canvas');
qrcode.canvas_qr2.id = "qr-canvas";
qrcode.qrcontext2 = qrcode.canvas_qr2.getContext('2d');
qrcode.canvas_qr2.width = qrcode.video.videoWidth;
qrcode.canvas_qr2.height = qrcode.video.videoHeight;
setTimeout(qrcode.captureToCanvas, 500);
}
qrcode.vidError = function(error)
{
qrcode.gUM=false;
return;
}
qrcode.captureToCanvas = function()
{
if(qrcode.gUM)
{
try{
if(qrcode.video.videoWidth == 0)
{
setTimeout(qrcode.captureToCanvas, 500);
return;
}
else
{
qrcode.canvas_qr2.width = qrcode.video.videoWidth;
qrcode.canvas_qr2.height = qrcode.video.videoHeight;
}
qrcode.qrcontext2.drawImage(qrcode.video,0,0);
try{
qrcode.decode();
}
catch(e){
console.log(e);
setTimeout(qrcode.captureToCanvas, 500);
};
}
catch(e){
console.log(e);
setTimeout(qrcode.captureToCanvas, 500);
};
}
}
qrcode.setWebcam = function(videoId)
{
var n=navigator;
qrcode.video=document.getElementById(videoId);
var options = true;
if(navigator.mediaDevices && navigator.mediaDevices.enumerateDevices)
{
try{
navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
devices.forEach(function(device) {
console.log("deb1");
if (device.kind === 'videoinput') {
if(device.label.toLowerCase().search("back") >-1)
options=[{'sourceId': device.deviceId}] ;
}
console.log(device.kind + ": " + device.label +
" id = " + device.deviceId);
});
})
}
catch(e)
{
console.log(e);
}
}
else{
console.log("no navigator.mediaDevices.enumerateDevices" );
}
if(n.getUserMedia)
n.getUserMedia({video: options, audio: false}, qrcode.vidSuccess, qrcode.vidError);
else
if(n.webkitGetUserMedia)
{
qrcode.webkit=true;
n.webkitGetUserMedia({video:options, audio: false}, qrcode.vidSuccess, qrcode.vidError);
}
else
if(n.mozGetUserMedia)
{
qrcode.moz=true;
n.mozGetUserMedia({video: options, audio: false}, qrcode.vidSuccess, qrcode.vidError);
}
}
qrcode.decode = function(src){
if(arguments.length==0)
{
if(qrcode.canvas_qr2)
{
var canvas_qr = qrcode.canvas_qr2;
var context = qrcode.qrcontext2;
}
else
{
var canvas_qr = document.getElementById("qr-canvas");
var context = canvas_qr.getContext('2d');
}
qrcode.width = canvas_qr.width;
qrcode.height = canvas_qr.height;
qrcode.imagedata = context.getImageData(0, 0, qrcode.width, qrcode.height);
@ -47,6 +164,14 @@ qrcode.decode = function(src){
image.crossOrigin = "Anonymous";
image.onload=function(){
//var canvas_qr = document.getElementById("qr-canvas");
var canvas_out = document.getElementById("out-canvas");
if(canvas_out!=null)
{
var outctx = canvas_out.getContext('2d');
outctx.clearRect(0, 0, 320, 240);
outctx.drawImage(image, 0, 0, 320, 240);
}
var canvas_qr = document.createElement('canvas');
var context = canvas_qr.getContext('2d');
var nheight = image.height;
@ -85,6 +210,11 @@ qrcode.decode = function(src){
if(qrcode.callback!=null)
qrcode.callback(qrcode.result);
}
image.onerror = function ()
{
if(qrcode.callback!=null)
qrcode.callback("Failed to load the image");
}
image.src = src;
}
}
@ -154,7 +284,9 @@ qrcode.process = function(ctx){
var qRCodeMatrix = detector.detect();
/*for (var y = 0; y < qRCodeMatrix.bits.Height; y++)
if(qrcode.debug)
{
for (var y = 0; y < qRCodeMatrix.bits.Height; y++)
{
for (var x = 0; x < qRCodeMatrix.bits.Width; x++)
{
@ -163,11 +295,10 @@ qrcode.process = function(ctx){
qrcode.imagedata.data[point+1] = qRCodeMatrix.bits.get_Renamed(x,y)?0:0;
qrcode.imagedata.data[point+2] = qRCodeMatrix.bits.get_Renamed(x,y)?255:0;
}
}*/
if(qrcode.debug)
}
ctx.putImageData(qrcode.imagedata, 0, 0);
}
console.log(qRCodeMatrix);
var reader = Decoder.decode(qRCodeMatrix.bits);
var data = reader.DataByte;
@ -193,8 +324,8 @@ qrcode.getPixel = function(x,y){
if (qrcode.height < y) {
throw "point error";
}
point = (x * 4) + (y * qrcode.width * 4);
p = (qrcode.imagedata.data[point]*33 + qrcode.imagedata.data[point + 1]*34 + qrcode.imagedata.data[point + 2]*33)/100;
var point = (x * 4) + (y * qrcode.width * 4);
var p = (qrcode.imagedata.data[point]*33 + qrcode.imagedata.data[point + 1]*34 + qrcode.imagedata.data[point + 2]*33)/100;
return p;
}
@ -271,7 +402,11 @@ qrcode.grayScaleToBitmap=function(grayScale)
var sqrtNumArea = middle.length;
var areaWidth = Math.floor(qrcode.width / sqrtNumArea);
var areaHeight = Math.floor(qrcode.height / sqrtNumArea);
var bitmap = new Array(qrcode.height*qrcode.width);
var buff = new ArrayBuffer(qrcode.width*qrcode.height);
var bitmap = new Uint8Array(buff);
//var bitmap = new Array(qrcode.height*qrcode.width);
for (var ay = 0; ay < sqrtNumArea; ay++)
{
@ -289,8 +424,12 @@ qrcode.grayScaleToBitmap=function(grayScale)
return bitmap;
}
qrcode.grayscale = function(){
var ret = new Array(qrcode.width*qrcode.height);
qrcode.grayscale = function()
{
var buff = new ArrayBuffer(qrcode.width*qrcode.height);
var ret = new Uint8Array(buff);
//var ret = new Array(qrcode.width*qrcode.height);
for (var y = 0; y < qrcode.height; y++)
{
for (var x = 0; x < qrcode.width; x++)
@ -314,9 +453,3 @@ function URShift( number, bits)
return (number >> bits) + (2 << ~bits);
}
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};

View file

@ -36,9 +36,9 @@ function ReedSolomonDecoder(field)
for (var i = 0; i < twoS; i++)
{
// Thanks to sanfordsquires for this fix:
var eval = poly.evaluateAt(this.field.exp(dataMatrix?i + 1:i));
syndromeCoefficients[syndromeCoefficients.length - 1 - i] = eval;
if (eval != 0)
var evalu = poly.evaluateAt(this.field.exp(dataMatrix?i + 1:i));
syndromeCoefficients[syndromeCoefficients.length - 1 - i] = evalu;
if (evalu != 0)
{
noError = false;
}

View file

@ -29,59 +29,48 @@ function ECB(count, dataCodewords)
this.count = count;
this.dataCodewords = dataCodewords;
Object.defineProperties(this, {
'Count': {
get: function () {
this.__defineGetter__("Count", function()
{
return this.count;
}
},
'DataCodewords': {
get: function () {
});
this.__defineGetter__("DataCodewords", function()
{
return this.dataCodewords;
}
}
});
}
function ECBlocks( ecCodewordsPerBlock, ecBlocks1, ecBlocks2)
{
this.ecCodewordsPerBlock = ecCodewordsPerBlock;
if(ecBlocks2)
this.ecBlocks = new Array(ecBlocks1, ecBlocks2);
else
this.ecBlocks = new Array(ecBlocks1);
Object.defineProperties(this, {
"ECCodewordsPerBlock": {
get: function () {
this.__defineGetter__("ECCodewordsPerBlock", function()
{
return this.ecCodewordsPerBlock;
}
},
"TotalECCodewords": {
get: function () {
return this.ecCodewordsPerBlock * this.NumBlocks;
}
},
"NumBlocks": {
get: function () {
var total = 0;
for (var i = 0; i < this.ecBlocks.length; i++)
total += this.ecBlocks[i].length;
return total;
}
}
});
this.getECBlocks = function() {
this.__defineGetter__("TotalECCodewords", function()
{
return this.ecCodewordsPerBlock * this.NumBlocks;
});
this.__defineGetter__("NumBlocks", function()
{
var total = 0;
for (var i = 0; i < this.ecBlocks.length; i++)
{
total += this.ecBlocks[i].length;
}
return total;
});
this.getECBlocks=function()
{
return this.ecBlocks;
};
}
}
function Version( versionNumber, alignmentPatternCenters, ecBlocks1, ecBlocks2, ecBlocks3, ecBlocks4)
@ -100,28 +89,22 @@ function Version( versionNumber, alignmentPatternCenters, ecBlocks1, ecBlocks
}
this.totalCodewords = total;
Object.defineProperties(this, {
"VersionNumber": {
get: function () {
this.__defineGetter__("VersionNumber", function()
{
return this.versionNumber;
}
},
});
"AlignmentPatternCenters": {
get: function () {
this.__defineGetter__("AlignmentPatternCenters", function()
{
return this.alignmentPatternCenters;
}
},
"TotalCodewords": {
get: function () {
});
this.__defineGetter__("TotalCodewords", function()
{
return this.totalCodewords;
}
},
"DimensionForVersion": {
get: function () {
});
this.__defineGetter__("DimensionForVersion", function()
{
return 17 + 4 * this.versionNumber;
}
}
});
this.buildFunctionPattern=function()

View file

@ -1,33 +1,42 @@
var VERSION = '0.2.0';
var qr_version = 1;
var qr_pixel_size = 15;
var qr_size = 17+(qr_version*4);
var qr_array = [];
var qr_format_array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];
var active_painter = "0";
var fill_painter = false;
var toggle_painter = false;
var dragging_painter = false;
var changed_state = false;
var show_grey = true;
var brute_force_mode = false;
var analysis_mode = false;
var qr_temp_array = [];
var qr_data_block = [];
var is_data_module = [];
var history_array = [];
var active_history = -1;
/*
****************************************
GLOBAL VARIABLES
****************************************
*/
var APP_VERSION = '0.3.3';
var qr_version = 1; //Current QR version (1-9)
var qr_pixel_size = 10; //Current view size of QR code (pixel per module)
var qr_size = 17+(qr_version*4); //Current size of QR code
var qr_array = []; //Main array to store QR data
var qr_format_array = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]; //Store QR format information
var active_painter = "0"; //Current active painter tool (0,1,2)
var fill_painter = false; //Is flood fill tool active?
var changed_state = false; //Is document in changed state and not saved yet?
var show_grey = true; //Show grey modules in Decode mode
var brute_force_mode = false; //Is Brute-force Format Info active?
var analysis_mode = false; //Is Data Analysis tool active?
var qr_temp_array = []; //Temporary variable to handle qr_array duplicates
var qr_data_block = []; //Array to store data block in "Data Analysis tool"
var is_data_module = []; //Store data that separate between data module and fixed module (function pattern, alignment pattern, etc)
var history_array = []; //Store history information and its qr_array data
var active_history = -1; //Current active history
/***
*
* generate QR table based on qr_array
*
***/
function generateTable(version){
qr_array = JSON.parse(JSON.stringify(qr_templates[version-1]));
changed_state = false;
@ -57,6 +66,11 @@ function generateTable(version){
updateHistory("New QR code");
}
/***
*
* get format information value
*
***/
function getInformation(size){
//Information top-left beside Finder
for(var i=0; i < 9; i++){
@ -89,7 +103,11 @@ function getInformation(size){
}
}
/***
*
* generate QR table in format information overlay dialog
*
***/
function generateInfoTable(position){
position = position || "TOP_LEFT";
@ -134,7 +152,11 @@ function generateInfoTable(position){
}
/***
*
* Save format information value to qr_format_array
*
***/
function saveInfoTable(size){
for(var i=0; i < 8; i++){
if(i > 5)
@ -158,6 +180,11 @@ function saveInfoTable(size){
changed_state = true;
}
/***
*
* Reload QR table based on qr_array value
*
***/
function refreshTable(){
for(var i=0; i < qr_array.length; i++){
for(var j=0; j < qr_array[i].length; j++){
@ -174,6 +201,11 @@ function refreshTable(){
}
}
/***
*
* Update qr_array from new array (exclude fixed pattern: function pattern, alignment pattern, timing, and version information)
*
***/
function updateQRArray(new_data){
for(var i=0; i < qr_array.length; i++){
for(var j=0; j < qr_array[i].length; j++){
@ -182,8 +214,33 @@ function updateQRArray(new_data){
}
}
}
//update format information when using image upload
var size = qr_size;
for(var i=0; i < 8; i++){
if(i > 5)
qr_array[i+1][8] = new_data[i+1][8];
else
qr_array[i][8] = new_data[i][8];
qr_array[8][size-(i+1)] = new_data[8][size-(i+1)];
}
var index = 0;
for(var i=14; i >= 8; i--){
if(index > 5)
qr_array[8][index+1] = new_data[8][index+1];
else
qr_array[8][index] = new_data[8][index];;
qr_array[size-(index+1)][8] = new_data[size-(index+1)][8];;
index++;
}
}
/***
*
* Get format information from format information overlay dialog
*
***/
function getInfoBits(){
var result = {ecc:"",mask:-1};
$("#slider-mask div.active").removeClass("active");
@ -224,6 +281,11 @@ function getInfoBits(){
return result;
}
/***
*
* generate QR code made from canvas based on qr_array values
*
***/
function generateResult(){
var c = document.getElementById("qr-result");
@ -262,17 +324,32 @@ function generateResult(){
$("body").css("background-color","#FFFFFF");
}
/***
*
* Update toolbox values
*
***/
function updateToolbox(){
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
$("#qr-size").val(qr_pixel_size+"px");
}
/***
*
* Resize QR size
*
***/
function resize(size){
$("td").each(function(){
$(this).css({"min-width":size+"px","min-height":size+"px","width":size+"px","height":size+"px"});
})
}
/***
*
* Toggle between Editor and Decode mode
*
***/
function toggleResult(){
if(!$("#btn-switch-mode").hasClass("active")){
$(".mode-indicator button").removeClass("active");
@ -313,6 +390,11 @@ function toggleResult(){
}
}
/***
*
* Load image from file and put to {target}
*
***/
function loadImage(input, target){
if(input.files && input.files[0]){
var reader = new FileReader();
@ -324,6 +406,11 @@ function loadImage(input, target){
}
}
/***
*
* Save project to LocalStorage
*
***/
function saveProject(projectName){
if(projectName == ""){
@ -354,6 +441,11 @@ function saveProject(projectName){
changed_state = false;
}
/***
*
* Load project from LocalStorage
*
***/
function loadProject(name){
if(changed_state){
if(!confirm("Are you sure want to proceed?\nYour unsaved progress will be lost!"))
@ -385,6 +477,11 @@ function loadProject(name){
updateHistory("Load project");
}
/***
*
* Remove project from LocalStorage
*
***/
function removeProject(name, origin){
if(confirm("Are you sure want to permanently delete this project?")){
var dataList = JSON.parse(localStorage.getItem("dataList"));
@ -404,6 +501,11 @@ function removeProject(name, origin){
}
}
/***
*
* Refresh list of project in LocalStorage
*
***/
function refreshLoadList(origin){
var dataList = JSON.parse(localStorage.getItem("dataList"));
if(dataList == undefined){
@ -417,6 +519,11 @@ function refreshLoadList(origin){
}
}
/***
*
* Decode Base64 to image
*
***/
function decodeFromBase64(img, callback){
qrcode.callback = callback;
qrcode.decode(img, callback);
@ -463,7 +570,7 @@ function importFromImage(src, cb){
var qrArray = qRCodeMatrix.bits.bits;
var size = qRCodeMatrix.bits.width;
if(size > 41){
if(size > 53){
alert("QR version is unsupported");
return;
}
@ -484,7 +591,14 @@ function importFromImage(src, cb){
img.src = src;
}
//Reference : https://jsfiddle.net/eWxNE/2/
/***
*
* Flood fill algorithm to perform paint-like bucket tool
*
* Reference : https://jsfiddle.net/eWxNE/2/
*
***/
function floodFill(x, y, oldVal, newVal){
x = parseInt(x);
@ -517,6 +631,11 @@ function floodFill(x, y, oldVal, newVal){
}
}
/***
*
* Update history
*
***/
function updateHistory(msg){
if(active_history < 10) active_history++;
@ -538,6 +657,11 @@ function updateHistory(msg){
$(".history").html(html);
}
/***
*
* Get history value and refresh QR table
*
***/
function getHistory(index){
qr_array = JSON.parse(history_array[index][1]);
if(qr_array.length != qr_size){
@ -548,6 +672,11 @@ function getHistory(index){
refreshTable();
}
/***
*
* Clear all history value
*
***/
function clearHistory(){
history_array = [];
active_history = -1;
@ -691,6 +820,11 @@ function bruteForceFormatInfo(){
}
}
/***
*
* Mask qr_array with mask_pattern and refresh QR table
*
***/
function maskDataBits(){
var mask_pattern = getFormatInfo(qr_array).mask;
qr_array = maskData(qr_array, mask_pattern);
@ -787,9 +921,15 @@ function recoverPadding(){
qr_temp_array = Array.prototype.slice.call(result.result_array);
}
/***
*
* Perform Reed-Solomon decode
*
***/
function reedSolomonDecode(data, nysm){
var result = [];
//console.log('nysm: '+nysm, 'data: '+data);
for(var i=0; i < data.length; i++){
var err_pos = [];
@ -1155,6 +1295,12 @@ function updateBlock(value, cls){
}
/*******************************************************************
*
* EVENT LISTENER USING JQUERY
*
********************************************************************/
$(document).ready(function(){
@ -1308,7 +1454,7 @@ $(document).ready(function(){
$("#btn-version-plus").click(function(){
if(changed_state){
if(confirm("Are you sure want to proceed?\nYour unsaved progress will be lost!")){
if(qr_version != 6){
if(qr_version != 9){
qr_version += 1;
qr_size = 17+(qr_version*4);
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
@ -1316,7 +1462,7 @@ $(document).ready(function(){
}
}
} else {
if(qr_version != 6){
if(qr_version != 9){
qr_version += 1;
qr_size = 17+(qr_version*4);
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
@ -2048,7 +2194,7 @@ $(document).ready(function(){
}
})
$("#txt-version").text('QRazyBox v'+VERSION);
$("#txt-version").text('QRazyBox v'+APP_VERSION);
$("#mobile-editor-mode, #mobile-decode-mode").click(function(){
toggleResult();

View file

@ -433,6 +433,8 @@ function rs_forney_syndromes(synd, pos, nmess){
function rs_correct_msg(msg_in, nysm, erase_pos){
console.log(msg_in);
erase_pos = erase_pos || undefined;
var msg_len = msg_in.length - nysm;

View file

@ -222,6 +222,19 @@ function getDataModule(data){
}
}
if(version >= 7){
for(var i=0; i < 6; i++){
for(var j=0; j < 3; j++){
is_data_module[i][(width)-11 + j] = false
}
}
for(var j=0; j < 6; j++){
for(var i=0; i < 3; i++){
is_data_module[(width)-11 + i][j] = false
}
}
}
return is_data_module;
}
@ -905,7 +918,7 @@ function QRDecode(data){
//TODO: Kanji mode
break;
} else {
console.log("[ERROR]: Invalid Encoding mode");
console.log("[ERROR]: Invalid Encoding mode", mode);
result.error.push("Invalid Encoding mode");
break;
}

View file

@ -3,7 +3,7 @@
*********************************************************************/
//Pattern (bitmatrix) template for Function pattern and Format info
//Pattern (bitmatri-1) template for Function pattern and Format info
var function_pattern_with_format_info = {
/*
0 : white
@ -53,7 +53,10 @@ var alignment_pattern_array = [
[6, 22],
[6, 26],
[6, 30],
[6, 34]
[6, 34],
[6, 22, 38],
[6, 24, 42],
[6, 26, 46]
];
var format_information_bits_raw = {
@ -226,13 +229,23 @@ var format_information_unmask = [
'111111111111111'
];
//Version information table for QR version 7 and higher
var version_information_table = [
000111110010010100,
001000010110111100,
001001101010011001
]
var data_code_num_table = [
[ 16, 19, 9, 13],
[ 28, 34, 16, 22],
[ 44, 55, 26, 34],
[ 64, 80, 36, 48],
[ 86, 108, 46, 62],
[ 108, 136, 60, 76]
[ 108, 136, 60, 76],
[ 124, 156, 66, 88],
[ 154, 194, 86, 110],
[ 182, 232, 100, 132]
];
var RS_block_num_table = [
@ -241,7 +254,10 @@ var RS_block_num_table = [
[1, 1, 2, 2],
[2, 1, 4, 2],
[2, 1, 4, 4],
[4, 2, 4, 4]
[4, 2, 4, 4],
[4, 2, 5, 6],
[4, 2, 6, 6],
[5, 2, 8, 8]
];
var alphanumeric_table = [
@ -261,14 +277,17 @@ var error_correction_code_table = [
[26,15,22,18],
[18,20,16,26],
[24,26,22,18],
[16,18,28,24]
[16,18,28,24],
[18,20,26,18],
[22,24,26,22],
[22,30,24,20]
];
var remainder_bits_table = [0,7,7,7,7,7];
var remainder_bits_table = [0,7,7,7,7,7,0,0,0];
/************************************************************
Pre-defined QR matrix template for faster computing
Pre-defined QR matri-1 template for faster computing
0 : white
1 : black
@ -277,6 +296,9 @@ var remainder_bits_table = [0,7,7,7,7,7];
*************************************************************/
var qr_templates = [
[
/****************
VERSION 1
****************/
[1,1,1,1,1,1,1,0,0,-1,-1,-1,-1,0,1,1,1,1,1,1,1],
[1,0,0,0,0,0,1,0,0,-1,-1,-1,-1,0,1,0,0,0,0,0,1],
[1,0,1,1,1,0,1,0,0,-1,-1,-1,-1,0,1,0,1,1,1,0,1],
@ -301,6 +323,9 @@ var qr_templates = [
],
[
/****************
VERSION 2
****************/
[1,1,1,1,1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,0,1,1,1,1,1,1,1],
[1,0,0,0,0,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,0,0,0,0,1],
[1,0,1,1,1,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,1,1,1,0,1],
@ -329,6 +354,9 @@ var qr_templates = [
],
[
/****************
VERSION 3
****************/
[1,1,1,1,1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,1,1,1,1,1,1],
[1,0,0,0,0,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,0,0,0,0,1],
[1,0,1,1,1,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,1,1,1,0,1],
@ -361,6 +389,9 @@ var qr_templates = [
],
[
/****************
VERSION 4
****************/
[1,1,1,1,1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,1,1,1,1,1,1],
[1,0,0,0,0,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,0,0,0,0,1],
[1,0,1,1,1,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,1,1,1,0,1],
@ -397,6 +428,9 @@ var qr_templates = [
],
[
/****************
VERSION 5
****************/
[1,1,1,1,1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,1,1,1,1,1,1],
[1,0,0,0,0,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,0,0,0,0,1],
[1,0,1,1,1,0,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,0,1,1,1,0,1],
@ -437,6 +471,9 @@ var qr_templates = [
],
[
/****************
VERSION 6
****************/
[1,1,1,1,1,1,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1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