mirror of
https://github.com/Merricx/qrazybox.git
synced 2025-03-14 00:29:03 +01:00
Update support for QR version 7 to 9
This commit is contained in:
parent
a521c5b30a
commit
ce2de974bd
23 changed files with 3297 additions and 2815 deletions
|
@ -89,7 +89,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
<h5>Module Size :</h5>
|
<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 class="toolbox">
|
||||||
<div id="btn-size-min" class="minus"><img src="img/minus.png"></div>
|
<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>
|
<div id="btn-size-plus" class="plus"><img src="img/plus.png"></div>
|
||||||
|
@ -329,7 +329,7 @@
|
||||||
<h3>QR Decoder</h3>
|
<h3>QR Decoder</h3>
|
||||||
<div class="space"></div>
|
<div class="space"></div>
|
||||||
<h5>Decoded Message : </h5>
|
<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 class="clear"></div>
|
||||||
<div id="div-decode-error" class="hide">
|
<div id="div-decode-error" class="hide">
|
||||||
<h5>Error : </h5>
|
<h5>Error : </h5>
|
||||||
|
|
|
@ -30,32 +30,22 @@ function AlignmentPattern(posX, posY, estimatedModuleSize)
|
||||||
this.count = 1;
|
this.count = 1;
|
||||||
this.estimatedModuleSize = estimatedModuleSize;
|
this.estimatedModuleSize = estimatedModuleSize;
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("EstimatedModuleSize", function()
|
||||||
'EstimatedModuleSize': {
|
{
|
||||||
get: function () {
|
return this.estimatedModuleSize;
|
||||||
return this.estimatedModuleSize;
|
});
|
||||||
}
|
this.__defineGetter__("Count", function()
|
||||||
},
|
{
|
||||||
|
return this.count;
|
||||||
"Count": {
|
});
|
||||||
get: function() {
|
this.__defineGetter__("X", function()
|
||||||
return this.count;
|
{
|
||||||
}
|
return Math.floor(this.x);
|
||||||
},
|
});
|
||||||
|
this.__defineGetter__("Y", function()
|
||||||
"X": {
|
{
|
||||||
get: function() {
|
return Math.floor(this.y);
|
||||||
return Math.floor(this.x);
|
});
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"Y": {
|
|
||||||
get: function() {
|
|
||||||
return Math.floor(this.y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.incrementCount = function()
|
this.incrementCount = function()
|
||||||
{
|
{
|
||||||
this.count++;
|
this.count++;
|
||||||
|
|
|
@ -34,39 +34,31 @@ function BitMatrix( width, height)
|
||||||
this.width = width;
|
this.width = width;
|
||||||
this.height = height;
|
this.height = height;
|
||||||
var rowSize = width >> 5;
|
var rowSize = width >> 5;
|
||||||
if ((width & 0x1f) != 0) {
|
if ((width & 0x1f) != 0)
|
||||||
|
{
|
||||||
rowSize++;
|
rowSize++;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.rowSize = rowSize;
|
this.rowSize = rowSize;
|
||||||
this.bits = new Array(rowSize * height);
|
this.bits = new Array(rowSize * height);
|
||||||
|
|
||||||
for(var i=0;i<this.bits.length;i++)
|
for(var i=0;i<this.bits.length;i++)
|
||||||
this.bits[i]=0;
|
this.bits[i]=0;
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("Width", function()
|
||||||
'Width': {
|
{
|
||||||
get: function () {
|
return this.width;
|
||||||
return this.width;
|
});
|
||||||
}
|
this.__defineGetter__("Height", function()
|
||||||
},
|
{
|
||||||
|
return this.height;
|
||||||
'Height': {
|
});
|
||||||
get: function () {
|
this.__defineGetter__("Dimension", function()
|
||||||
return this.height;
|
{
|
||||||
}
|
if (this.width != this.height)
|
||||||
},
|
{
|
||||||
|
throw "Can't call getDimension() on a non-square matrix";
|
||||||
'Dimension': {
|
}
|
||||||
get: function () {
|
return this.width;
|
||||||
if (this.width != this.height) {
|
});
|
||||||
throw "Can't call getDimension() on a non-square matrix";
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.get_Renamed=function( x, y)
|
this.get_Renamed=function( x, y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,19 +28,14 @@ function DataBlock(numDataCodewords, codewords)
|
||||||
this.numDataCodewords = numDataCodewords;
|
this.numDataCodewords = numDataCodewords;
|
||||||
this.codewords = codewords;
|
this.codewords = codewords;
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("NumDataCodewords", function()
|
||||||
'NumDataCodewords': {
|
{
|
||||||
get: function () {
|
return this.numDataCodewords;
|
||||||
return this.numDataCodewords;
|
});
|
||||||
}
|
this.__defineGetter__("Codewords", function()
|
||||||
},
|
{
|
||||||
|
return this.codewords;
|
||||||
'Codewords': {
|
});
|
||||||
get: function () {
|
|
||||||
return this.codewords;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DataBlock.getDataBlocks=function(rawCodewords, version, ecLevel)
|
DataBlock.getDataBlocks=function(rawCodewords, version, ecLevel)
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
|
function QRCodeDataBlockReader(blocks, version, numErrorCorrectionCode)
|
||||||
|
{
|
||||||
this.blockPointer = 0;
|
this.blockPointer = 0;
|
||||||
this.bitPointer = 7;
|
this.bitPointer = 7;
|
||||||
this.dataLength = 0;
|
this.dataLength = 0;
|
||||||
|
@ -36,249 +37,301 @@ function QRCodeDataBlockReader (blocks, version, numErrorCorrectionCode) {
|
||||||
else if (version >= 27 && version <= 40)
|
else if (version >= 27 && version <= 40)
|
||||||
this.dataLengthMode = 2;
|
this.dataLengthMode = 2;
|
||||||
|
|
||||||
this.getNextBits = function (numBits) {
|
this.getNextBits = function( numBits)
|
||||||
var bits = 0;
|
{
|
||||||
|
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++) {
|
|
||||||
mask += (1 << i);
|
|
||||||
}
|
|
||||||
mask <<= (this.bitPointer - numBits + 1);
|
|
||||||
|
|
||||||
bits = (this.blocks[this.blockPointer] & mask) >> (this.bitPointer - numBits + 1);
|
|
||||||
this.bitPointer -= numBits;
|
|
||||||
return bits;
|
|
||||||
} 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++)
|
|
||||||
{
|
{
|
||||||
mask1 += (1 << i);
|
// next word fits into current data block
|
||||||
}
|
var mask = 0;
|
||||||
bits = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));
|
for (var i = 0; i < numBits; i++)
|
||||||
this.blockPointer++;
|
{
|
||||||
bits += ((this.blocks[this.blockPointer]) >> (8 - (numBits - (this.bitPointer + 1))));
|
mask += (1 << i);
|
||||||
|
}
|
||||||
|
mask <<= (this.bitPointer - numBits + 1);
|
||||||
|
|
||||||
this.bitPointer = this.bitPointer - numBits % 8;
|
bits = (this.blocks[this.blockPointer] & mask) >> (this.bitPointer - numBits + 1);
|
||||||
if (this.bitPointer < 0)
|
this.bitPointer -= numBits;
|
||||||
|
return bits;
|
||||||
|
}
|
||||||
|
else if (numBits < this.bitPointer + 1 + 8)
|
||||||
{
|
{
|
||||||
this.bitPointer = 8 + this.bitPointer;
|
// next word crosses 2 data blocks
|
||||||
|
var mask1 = 0;
|
||||||
|
for (var i = 0; i < this.bitPointer + 1; i++)
|
||||||
|
{
|
||||||
|
mask1 += (1 << i);
|
||||||
|
}
|
||||||
|
bits = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));
|
||||||
|
this.blockPointer++;
|
||||||
|
bits += ((this.blocks[this.blockPointer]) >> (8 - (numBits - (this.bitPointer + 1))));
|
||||||
|
|
||||||
|
this.bitPointer = this.bitPointer - numBits % 8;
|
||||||
|
if (this.bitPointer < 0)
|
||||||
|
{
|
||||||
|
this.bitPointer = 8 + this.bitPointer;
|
||||||
|
}
|
||||||
|
return bits;
|
||||||
}
|
}
|
||||||
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
|
|
||||||
//bitPointer + 1 : number of bits of the 1st block
|
|
||||||
//8 : number of the 2nd block (note that use already 8bits because next word uses 3 data blocks)
|
|
||||||
//numBits - (bitPointer + 1 + 8) : number of bits of the 3rd block
|
|
||||||
for (var i = 0; i < this.bitPointer + 1; i++)
|
|
||||||
{
|
{
|
||||||
mask1 += (1 << i);
|
// next word crosses 3 data blocks
|
||||||
|
var mask1 = 0; // mask of first block
|
||||||
|
var mask3 = 0; // mask of 3rd block
|
||||||
|
//bitPointer + 1 : number of bits of the 1st block
|
||||||
|
//8 : number of the 2nd block (note that use already 8bits because next word uses 3 data blocks)
|
||||||
|
//numBits - (bitPointer + 1 + 8) : number of bits of the 3rd block
|
||||||
|
for (var i = 0; i < this.bitPointer + 1; i++)
|
||||||
|
{
|
||||||
|
mask1 += (1 << i);
|
||||||
|
}
|
||||||
|
var bitsFirstBlock = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));
|
||||||
|
this.blockPointer++;
|
||||||
|
|
||||||
|
var bitsSecondBlock = this.blocks[this.blockPointer] << (numBits - (this.bitPointer + 1 + 8));
|
||||||
|
this.blockPointer++;
|
||||||
|
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
this.bitPointer = 8 + this.bitPointer;
|
||||||
|
}
|
||||||
|
return bits;
|
||||||
}
|
}
|
||||||
var bitsFirstBlock = (this.blocks[this.blockPointer] & mask1) << (numBits - (this.bitPointer + 1));
|
else
|
||||||
this.blockPointer++;
|
{
|
||||||
|
return 0;
|
||||||
var bitsSecondBlock = this.blocks[this.blockPointer] << (numBits - (this.bitPointer + 1 + 8));
|
|
||||||
this.blockPointer++;
|
|
||||||
|
|
||||||
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) {
|
|
||||||
this.bitPointer = 8 + this.bitPointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
return bits;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
};
|
this.NextMode=function()
|
||||||
|
{
|
||||||
this.NextMode = function () {
|
|
||||||
if ((this.blockPointer > this.blocks.length - this.numErrorCorrectionCode - 2))
|
if ((this.blockPointer > this.blocks.length - this.numErrorCorrectionCode - 2))
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return this.getNextBits(4);
|
return this.getNextBits(4);
|
||||||
};
|
}
|
||||||
|
this.getDataLength=function( modeIndicator)
|
||||||
this.getDataLength=function( modeIndicator) {
|
|
||||||
var index = 0;
|
|
||||||
while (true)
|
|
||||||
{
|
{
|
||||||
if ((modeIndicator >> index) == 1)
|
var index = 0;
|
||||||
break;
|
while (true)
|
||||||
index++;
|
{
|
||||||
|
if ((modeIndicator >> index) == 1)
|
||||||
|
break;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.getNextBits(qrcode.sizeOfDataLengthInfo[this.dataLengthMode][index]);
|
||||||
}
|
}
|
||||||
|
this.getRomanAndFigureString=function( dataLength)
|
||||||
return this.getNextBits(qrcode.sizeOfDataLengthInfo[this.dataLengthMode][index]);
|
{
|
||||||
};
|
|
||||||
|
|
||||||
this.getRomanAndFigureString = function (dataLength) {
|
|
||||||
var length = dataLength;
|
var length = dataLength;
|
||||||
var intData = 0;
|
var intData = 0;
|
||||||
var strData = "";
|
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', ' ', '$', '%', '*', '+', '-', '.', '/', ':');
|
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
|
||||||
do {
|
{
|
||||||
if (length > 1) {
|
if (length > 1)
|
||||||
|
{
|
||||||
intData = this.getNextBits(11);
|
intData = this.getNextBits(11);
|
||||||
var firstLetter = Math.floor(intData / 45);
|
var firstLetter = Math.floor(intData / 45);
|
||||||
var secondLetter = intData % 45;
|
var secondLetter = intData % 45;
|
||||||
strData += tableRomanAndFigure[firstLetter];
|
strData += tableRomanAndFigure[firstLetter];
|
||||||
strData += tableRomanAndFigure[secondLetter];
|
strData += tableRomanAndFigure[secondLetter];
|
||||||
length -= 2;
|
length -= 2;
|
||||||
} else if (length == 1) {
|
}
|
||||||
|
else if (length == 1)
|
||||||
|
{
|
||||||
intData = this.getNextBits(6);
|
intData = this.getNextBits(6);
|
||||||
strData += tableRomanAndFigure[intData];
|
strData += tableRomanAndFigure[intData];
|
||||||
length -= 1;
|
length -= 1;
|
||||||
}
|
}
|
||||||
} while (length > 0);
|
}
|
||||||
|
while (length > 0);
|
||||||
|
|
||||||
return strData;
|
return strData;
|
||||||
};
|
|
||||||
|
|
||||||
this.getFigureString=function( dataLength) {
|
|
||||||
var length = dataLength;
|
|
||||||
var intData = 0;
|
|
||||||
var strData = "";
|
|
||||||
do
|
|
||||||
{
|
|
||||||
if (length >= 3)
|
|
||||||
{
|
|
||||||
intData = this.getNextBits(10);
|
|
||||||
if (intData < 100)
|
|
||||||
strData += "0";
|
|
||||||
if (intData < 10)
|
|
||||||
strData += "0";
|
|
||||||
length -= 3;
|
|
||||||
}
|
|
||||||
else if (length == 2)
|
|
||||||
{
|
|
||||||
intData = this.getNextBits(7);
|
|
||||||
if (intData < 10)
|
|
||||||
strData += "0";
|
|
||||||
length -= 2;
|
|
||||||
}
|
|
||||||
else if (length == 1)
|
|
||||||
{
|
|
||||||
intData = this.getNextBits(4);
|
|
||||||
length -= 1;
|
|
||||||
}
|
|
||||||
strData += intData;
|
|
||||||
}
|
}
|
||||||
while (length > 0);
|
this.getFigureString=function( dataLength)
|
||||||
|
{
|
||||||
return strData;
|
var length = dataLength;
|
||||||
};
|
var intData = 0;
|
||||||
|
var strData = "";
|
||||||
this.get8bitByteArray=function( dataLength) {
|
do
|
||||||
var length = dataLength;
|
{
|
||||||
var intData = 0;
|
if (length >= 3)
|
||||||
var output = new Array();
|
{
|
||||||
|
intData = this.getNextBits(10);
|
||||||
do {
|
if (intData < 100)
|
||||||
intData = this.getNextBits(8);
|
strData += "0";
|
||||||
output.push( intData);
|
if (intData < 10)
|
||||||
length--;
|
strData += "0";
|
||||||
} while (length > 0);
|
length -= 3;
|
||||||
|
}
|
||||||
return output;
|
else if (length == 2)
|
||||||
};
|
{
|
||||||
|
intData = this.getNextBits(7);
|
||||||
this.getKanjiString = function (dataLength) {
|
if (intData < 10)
|
||||||
var length = dataLength;
|
strData += "0";
|
||||||
var intData = 0;
|
length -= 2;
|
||||||
var unicodeString = "";
|
}
|
||||||
do {
|
else if (length == 1)
|
||||||
intData = getNextBits(13);
|
{
|
||||||
var lowerByte = intData % 0xC0;
|
intData = this.getNextBits(4);
|
||||||
var higherByte = intData / 0xC0;
|
length -= 1;
|
||||||
|
}
|
||||||
var tempWord = (higherByte << 8) + lowerByte;
|
strData += intData;
|
||||||
var shiftjisWord = 0;
|
|
||||||
if (tempWord + 0x8140 <= 0x9FFC) {
|
|
||||||
// between 8140 - 9FFC on Shift_JIS character set
|
|
||||||
shiftjisWord = tempWord + 0x8140;
|
|
||||||
} else {
|
|
||||||
// between E040 - EBBF on Shift_JIS character set
|
|
||||||
shiftjisWord = tempWord + 0xC140;
|
|
||||||
}
|
}
|
||||||
|
while (length > 0);
|
||||||
|
|
||||||
unicodeString += String.fromCharCode(shiftjisWord);
|
return strData;
|
||||||
length--;
|
}
|
||||||
} while (length > 0);
|
this.get8bitByteArray=function( dataLength)
|
||||||
|
{
|
||||||
|
var length = dataLength;
|
||||||
|
var intData = 0;
|
||||||
|
var output = new Array();
|
||||||
|
|
||||||
return unicodeString;
|
do
|
||||||
};
|
{
|
||||||
|
intData = this.getNextBits(8);
|
||||||
|
output.push( intData);
|
||||||
|
length--;
|
||||||
|
}
|
||||||
|
while (length > 0);
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
this.getKanjiString=function( dataLength)
|
||||||
|
{
|
||||||
|
var length = dataLength;
|
||||||
|
var intData = 0;
|
||||||
|
var unicodeString = "";
|
||||||
|
do
|
||||||
|
{
|
||||||
|
intData = this.getNextBits(13);
|
||||||
|
var lowerByte = intData % 0xC0;
|
||||||
|
var higherByte = intData / 0xC0;
|
||||||
|
|
||||||
Object.defineProperty(this, 'DataByte', {
|
var tempWord = (higherByte << 8) + lowerByte;
|
||||||
get: function () {
|
var shiftjisWord = 0;
|
||||||
var output = new Array();
|
if (tempWord + 0x8140 <= 0x9FFC)
|
||||||
var MODE_NUMBER = 1;
|
{
|
||||||
var MODE_ROMAN_AND_NUMBER = 2;
|
// between 8140 - 9FFC on Shift_JIS character set
|
||||||
var MODE_8BIT_BYTE = 4;
|
shiftjisWord = tempWord + 0x8140;
|
||||||
var MODE_KANJI = 8;
|
}
|
||||||
do {
|
else
|
||||||
var mode = this.NextMode();
|
{
|
||||||
if (mode == 0) {
|
// between E040 - EBBF on Shift_JIS character set
|
||||||
if (output.length > 0)
|
shiftjisWord = tempWord + 0xC140;
|
||||||
break;
|
}
|
||||||
else
|
|
||||||
throw "Empty data block";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode != MODE_NUMBER &&
|
//var tempByte = new Array(0,0);
|
||||||
mode != MODE_ROMAN_AND_NUMBER &&
|
//tempByte[0] = (sbyte) (shiftjisWord >> 8);
|
||||||
mode != MODE_8BIT_BYTE &&
|
//tempByte[1] = (sbyte) (shiftjisWord & 0xFF);
|
||||||
mode != MODE_KANJI) {
|
//unicodeString += new String(SystemUtils.ToCharArray(SystemUtils.ToByteArray(tempByte)));
|
||||||
|
unicodeString += String.fromCharCode(shiftjisWord);
|
||||||
|
length--;
|
||||||
|
}
|
||||||
|
while (length > 0);
|
||||||
|
|
||||||
mode = guessMode(mode);
|
|
||||||
throw "Invalid mode: " + mode + " in (block:" + this.blockPointer + " bit:" + this.bitPointer + ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
dataLength = this.getDataLength(mode);
|
return unicodeString;
|
||||||
|
}
|
||||||
|
|
||||||
if (dataLength < 1)
|
this.parseECIValue = function ()
|
||||||
throw "Invalid data length: " + dataLength;
|
{
|
||||||
switch (mode) {
|
var intData = 0;
|
||||||
case MODE_NUMBER:
|
var firstByte = this.getNextBits(8);
|
||||||
var temp_str = this.getFigureString(dataLength);
|
if ((firstByte & 0x80) == 0) {
|
||||||
var ta = new Array(temp_str.length);
|
intData = firstByte & 0x7F;
|
||||||
for(var j=0;j<temp_str.length;j++)
|
}
|
||||||
ta[j]=temp_str.charCodeAt(j);
|
if ((firstByte & 0xC0) == 0x80) {
|
||||||
output.push(ta);
|
// two bytes
|
||||||
break;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
case MODE_ROMAN_AND_NUMBER:
|
this.__defineGetter__("DataByte", function()
|
||||||
var temp_str = this.getRomanAndFigureString(dataLength);
|
{
|
||||||
var ta = new Array(temp_str.length);
|
var output = new Array();
|
||||||
for(var j=0;j<temp_str.length;j++)
|
var MODE_NUMBER = 1;
|
||||||
ta[j]=temp_str.charCodeAt(j);
|
var MODE_ROMAN_AND_NUMBER = 2;
|
||||||
output.push(ta );
|
var MODE_8BIT_BYTE = 4;
|
||||||
break;
|
var MODE_ECI = 7;
|
||||||
|
var MODE_KANJI = 8;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
var mode = this.NextMode();
|
||||||
|
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 != MODE_ECI)
|
||||||
|
{
|
||||||
|
throw "Invalid mode: " + mode + " in (block:" + this.blockPointer + " bit:" + this.bitPointer + ")";
|
||||||
|
}
|
||||||
|
|
||||||
case MODE_8BIT_BYTE:
|
if(mode == MODE_ECI)
|
||||||
var temp_sbyteArray3 = this.get8bitByteArray(dataLength);
|
{
|
||||||
output.push(temp_sbyteArray3);
|
var temp_sbyteArray3 = this.parseECIValue();
|
||||||
break;
|
//output.push(temp_sbyteArray3);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
case MODE_KANJI:
|
var dataLength = this.getDataLength(mode);
|
||||||
var temp_str = this.getKanjiString(dataLength);
|
if (dataLength < 1)
|
||||||
output.push(temp_str);
|
throw "Invalid data length: " + dataLength;
|
||||||
break;
|
switch (mode)
|
||||||
}
|
{
|
||||||
} while (true);
|
|
||||||
return output;
|
|
||||||
|
|
||||||
}
|
case MODE_NUMBER:
|
||||||
});
|
var temp_str = this.getFigureString(dataLength);
|
||||||
|
var ta = new Array(temp_str.length);
|
||||||
|
for(var j=0;j<temp_str.length;j++)
|
||||||
|
ta[j]=temp_str.charCodeAt(j);
|
||||||
|
output.push(ta);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_ROMAN_AND_NUMBER:
|
||||||
|
var temp_str = this.getRomanAndFigureString(dataLength);
|
||||||
|
var ta = new Array(temp_str.length);
|
||||||
|
for(var j=0;j<temp_str.length;j++)
|
||||||
|
ta[j]=temp_str.charCodeAt(j);
|
||||||
|
output.push(ta );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_8BIT_BYTE:
|
||||||
|
var temp_sbyteArray3 = this.get8bitByteArray(dataLength);
|
||||||
|
output.push(temp_sbyteArray3);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODE_KANJI:
|
||||||
|
var temp_str = this.getKanjiString(dataLength);
|
||||||
|
output.push(temp_str);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while (true);
|
||||||
|
return output;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
DataMask = {};
|
var DataMask = {};
|
||||||
|
|
||||||
DataMask.forReference = function(reference)
|
DataMask.forReference = function(reference)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
Decoder={};
|
var Decoder={};
|
||||||
Decoder.rsDecoder = new ReedSolomonDecoder(GF256.QR_CODE_FIELD);
|
Decoder.rsDecoder = new ReedSolomonDecoder(GF256.QR_CODE_FIELD);
|
||||||
|
|
||||||
Decoder.correctErrors=function( codewordBytes, numDataCodewords)
|
Decoder.correctErrors=function( codewordBytes, numDataCodewords)
|
||||||
|
@ -56,7 +56,7 @@ Decoder.correctErrors=function( codewordBytes, numDataCodewords)
|
||||||
|
|
||||||
Decoder.decode=function(bits)
|
Decoder.decode=function(bits)
|
||||||
{
|
{
|
||||||
var parser = new BitMatrixParser(bits);console.log(JSON.stringify(bits));
|
var parser = new BitMatrixParser(bits);
|
||||||
var version = parser.readVersion();
|
var version = parser.readVersion();
|
||||||
var ecLevel = parser.readFormatInformation().ErrorCorrectionLevel;
|
var ecLevel = parser.readFormatInformation().ErrorCorrectionLevel;
|
||||||
|
|
||||||
|
|
|
@ -90,21 +90,21 @@ PerspectiveTransform.quadrilateralToQuadrilateral=function( x0, y0, x1, y1,
|
||||||
|
|
||||||
PerspectiveTransform.squareToQuadrilateral=function( x0, y0, x1, y1, x2, y2, x3, y3)
|
PerspectiveTransform.squareToQuadrilateral=function( x0, y0, x1, y1, x2, y2, x3, y3)
|
||||||
{
|
{
|
||||||
dy2 = y3 - y2;
|
var dy2 = y3 - y2;
|
||||||
dy3 = y0 - y1 + y2 - y3;
|
var dy3 = y0 - y1 + y2 - y3;
|
||||||
if (dy2 == 0.0 && dy3 == 0.0)
|
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);
|
return new PerspectiveTransform(x1 - x0, x2 - x1, x0, y1 - y0, y2 - y1, y0, 0.0, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dx1 = x1 - x2;
|
var dx1 = x1 - x2;
|
||||||
dx2 = x3 - x2;
|
var dx2 = x3 - x2;
|
||||||
dx3 = x0 - x1 + x2 - x3;
|
var dx3 = x0 - x1 + x2 - x3;
|
||||||
dy1 = y1 - y2;
|
var dy1 = y1 - y2;
|
||||||
denominator = dx1 * dy2 - dx2 * dy1;
|
var denominator = dx1 * dy2 - dx2 * dy1;
|
||||||
a13 = (dx3 * dy2 - dx2 * dy3) / denominator;
|
var a13 = (dx3 * dy2 - dx2 * dy3) / denominator;
|
||||||
a23 = (dx1 * dy3 - dx3 * dy1) / 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);
|
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)
|
this.distance=function( pattern1, pattern2)
|
||||||
{
|
{
|
||||||
xDiff = pattern1.X - pattern2.X;
|
var xDiff = pattern1.X - pattern2.X;
|
||||||
yDiff = pattern1.Y - pattern2.Y;
|
var yDiff = pattern1.Y - pattern2.Y;
|
||||||
return Math.sqrt( (xDiff * xDiff + yDiff * yDiff));
|
return Math.sqrt( (xDiff * xDiff + yDiff * yDiff));
|
||||||
}
|
}
|
||||||
this.computeDimension=function( topLeft, topRight, bottomLeft, moduleSize)
|
this.computeDimension=function( topLeft, topRight, bottomLeft, moduleSize)
|
||||||
|
|
|
@ -28,32 +28,26 @@ function ErrorCorrectionLevel(ordinal, bits, name)
|
||||||
this.ordinal_Renamed_Field = ordinal;
|
this.ordinal_Renamed_Field = ordinal;
|
||||||
this.bits = bits;
|
this.bits = bits;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
this.__defineGetter__("Bits", function()
|
||||||
Object.defineProperties(this, {
|
{
|
||||||
'Bits': {
|
return this.bits;
|
||||||
get: function () {
|
});
|
||||||
return this.bits;
|
this.__defineGetter__("Name", function()
|
||||||
}
|
{
|
||||||
},
|
return this.name;
|
||||||
|
});
|
||||||
'Name': {
|
this.ordinal=function()
|
||||||
get: function () {
|
{
|
||||||
return this.name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.ordinal=function() {
|
|
||||||
return this.ordinal_Renamed_Field;
|
return this.ordinal_Renamed_Field;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ErrorCorrectionLevel.forBits=function( bits)
|
ErrorCorrectionLevel.forBits=function( bits)
|
||||||
{
|
{
|
||||||
if (bits < 0 || bits >= FOR_BITS.length) {
|
if (bits < 0 || bits >= FOR_BITS.length)
|
||||||
|
{
|
||||||
throw "ArgumentException";
|
throw "ArgumentException";
|
||||||
}
|
}
|
||||||
|
|
||||||
return FOR_BITS[bits];
|
return FOR_BITS[bits];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,126 +28,124 @@ var MAX_MODULES = 57;
|
||||||
var INTEGER_MATH_SHIFT = 8;
|
var INTEGER_MATH_SHIFT = 8;
|
||||||
var CENTER_QUORUM = 2;
|
var CENTER_QUORUM = 2;
|
||||||
|
|
||||||
qrcode.orderBestPatterns = function (patterns) {
|
qrcode.orderBestPatterns=function(patterns)
|
||||||
function distance( pattern1, pattern2) {
|
{
|
||||||
xDiff = pattern1.X - pattern2.X;
|
|
||||||
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 distance( pattern1, pattern2)
|
||||||
function crossProductZ( pointA, pointB, pointC) {
|
{
|
||||||
var bX = pointB.x;
|
var xDiff = pattern1.X - pattern2.X;
|
||||||
var bY = pointB.y;
|
var yDiff = pattern1.Y - pattern2.Y;
|
||||||
return ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX));
|
return Math.sqrt( (xDiff * xDiff + yDiff * yDiff));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find distances between pattern centers
|
/// <summary> Returns the z component of the cross product between vectors BC and BA.</summary>
|
||||||
var zeroOneDistance = distance(patterns[0], patterns[1]);
|
function crossProductZ( pointA, pointB, pointC)
|
||||||
var oneTwoDistance = distance(patterns[1], patterns[2]);
|
{
|
||||||
var zeroTwoDistance = distance(patterns[0], patterns[2]);
|
var bX = pointB.x;
|
||||||
|
var bY = pointB.y;
|
||||||
|
return ((pointC.x - bX) * (pointA.y - bY)) - ((pointC.y - bY) * (pointA.x - bX));
|
||||||
|
}
|
||||||
|
|
||||||
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) {
|
|
||||||
pointB = patterns[0];
|
|
||||||
pointA = patterns[1];
|
|
||||||
pointC = patterns[2];
|
|
||||||
} else if (zeroTwoDistance >= oneTwoDistance && zeroTwoDistance >= zeroOneDistance) {
|
|
||||||
pointB = patterns[1];
|
|
||||||
pointA = patterns[0];
|
|
||||||
pointC = patterns[2];
|
|
||||||
} else {
|
|
||||||
pointB = patterns[2];
|
|
||||||
pointA = patterns[0];
|
|
||||||
pointC = patterns[1];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Use cross product to figure out whether A and C are correct or flipped.
|
// Find distances between pattern centers
|
||||||
// This asks whether BC x BA has a positive z component, which is the arrangement
|
var zeroOneDistance = distance(patterns[0], patterns[1]);
|
||||||
// we want for A, B, C. If it's negative, then we've got it flipped around and
|
var oneTwoDistance = distance(patterns[1], patterns[2]);
|
||||||
// should swap A and C.
|
var zeroTwoDistance = distance(patterns[0], patterns[2]);
|
||||||
if (crossProductZ(pointA, pointB, pointC) < 0.0) {
|
|
||||||
var temp = pointA;
|
|
||||||
|
|
||||||
pointA = pointC;
|
var pointA, pointB, pointC;
|
||||||
pointC = temp;
|
// Assume one closest to other two is B; A and C will just be guesses at first
|
||||||
}
|
if (oneTwoDistance >= zeroOneDistance && oneTwoDistance >= zeroTwoDistance)
|
||||||
|
{
|
||||||
|
pointB = patterns[0];
|
||||||
|
pointA = patterns[1];
|
||||||
|
pointC = patterns[2];
|
||||||
|
}
|
||||||
|
else if (zeroTwoDistance >= oneTwoDistance && zeroTwoDistance >= zeroOneDistance)
|
||||||
|
{
|
||||||
|
pointB = patterns[1];
|
||||||
|
pointA = patterns[0];
|
||||||
|
pointC = patterns[2];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pointB = patterns[2];
|
||||||
|
pointA = patterns[0];
|
||||||
|
pointC = patterns[1];
|
||||||
|
}
|
||||||
|
|
||||||
patterns[0] = pointA;
|
// Use cross product to figure out whether A and C are correct or flipped.
|
||||||
patterns[1] = pointB;
|
// This asks whether BC x BA has a positive z component, which is the arrangement
|
||||||
patterns[2] = pointC;
|
// 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)
|
||||||
|
{
|
||||||
|
var temp = pointA;
|
||||||
|
pointA = pointC;
|
||||||
|
pointC = temp;
|
||||||
|
}
|
||||||
|
|
||||||
function FinderPattern (posX, posY, estimatedModuleSize) {
|
patterns[0] = pointA;
|
||||||
|
patterns[1] = pointB;
|
||||||
|
patterns[2] = pointC;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function FinderPattern(posX, posY, estimatedModuleSize)
|
||||||
|
{
|
||||||
this.x=posX;
|
this.x=posX;
|
||||||
this.y=posY;
|
this.y=posY;
|
||||||
this.count = 1;
|
this.count = 1;
|
||||||
this.estimatedModuleSize = estimatedModuleSize;
|
this.estimatedModuleSize = estimatedModuleSize;
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("EstimatedModuleSize", function()
|
||||||
"EstimatedModuleSize": {
|
{
|
||||||
get: function () {
|
return this.estimatedModuleSize;
|
||||||
return this.estimatedModuleSize;
|
});
|
||||||
}
|
this.__defineGetter__("Count", function()
|
||||||
},
|
{
|
||||||
|
return this.count;
|
||||||
"Count": {
|
});
|
||||||
get: function () {
|
this.__defineGetter__("X", function()
|
||||||
return this.count;
|
{
|
||||||
}
|
return this.x;
|
||||||
},
|
});
|
||||||
|
this.__defineGetter__("Y", function()
|
||||||
"X": {
|
{
|
||||||
get: function () {
|
return this.y;
|
||||||
return this.x;
|
});
|
||||||
}
|
this.incrementCount = function()
|
||||||
},
|
{
|
||||||
|
|
||||||
"Y": {
|
|
||||||
get: function () {
|
|
||||||
return this.y;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.incrementCount = function() {
|
|
||||||
this.count++;
|
this.count++;
|
||||||
};
|
}
|
||||||
|
this.aboutEquals=function( moduleSize, i, j)
|
||||||
this.aboutEquals = function (moduleSize, i, j) {
|
{
|
||||||
if (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize) {
|
if (Math.abs(i - this.y) <= moduleSize && Math.abs(j - this.x) <= moduleSize)
|
||||||
var moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);
|
{
|
||||||
|
var moduleSizeDiff = Math.abs(moduleSize - this.estimatedModuleSize);
|
||||||
return moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;
|
return moduleSizeDiff <= 1.0 || moduleSizeDiff / this.estimatedModuleSize <= 1.0;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
function FinderPatternInfo(patternCenters) {
|
function FinderPatternInfo(patternCenters)
|
||||||
|
{
|
||||||
this.bottomLeft = patternCenters[0];
|
this.bottomLeft = patternCenters[0];
|
||||||
this.topLeft = patternCenters[1];
|
this.topLeft = patternCenters[1];
|
||||||
this.topRight = patternCenters[2];
|
this.topRight = patternCenters[2];
|
||||||
|
this.__defineGetter__("BottomLeft", function()
|
||||||
Object.defineProperties(this, {
|
{
|
||||||
"BottomLeft": {
|
return this.bottomLeft;
|
||||||
get: function () {
|
});
|
||||||
return this.bottomLeft;
|
this.__defineGetter__("TopLeft", function()
|
||||||
}
|
{
|
||||||
},
|
return this.topLeft;
|
||||||
"TopLeft": {
|
});
|
||||||
get: function () {
|
this.__defineGetter__("TopRight", function()
|
||||||
return this.topLeft;
|
{
|
||||||
}
|
return this.topRight;
|
||||||
},
|
});
|
||||||
"TopRight": {
|
|
||||||
get: function () {
|
|
||||||
return this.topRight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function FinderPatternFinder()
|
function FinderPatternFinder()
|
||||||
|
@ -158,17 +156,15 @@ function FinderPatternFinder()
|
||||||
this.crossCheckStateCount = new Array(0,0,0,0,0);
|
this.crossCheckStateCount = new Array(0,0,0,0,0);
|
||||||
this.resultPointCallback = null;
|
this.resultPointCallback = null;
|
||||||
|
|
||||||
Object.defineProperty(this, 'CrossCheckStateCount', {
|
this.__defineGetter__("CrossCheckStateCount", function()
|
||||||
get: function () {
|
{
|
||||||
this.crossCheckStateCount[0] = 0;
|
this.crossCheckStateCount[0] = 0;
|
||||||
this.crossCheckStateCount[1] = 0;
|
this.crossCheckStateCount[1] = 0;
|
||||||
this.crossCheckStateCount[2] = 0;
|
this.crossCheckStateCount[2] = 0;
|
||||||
this.crossCheckStateCount[3] = 0;
|
this.crossCheckStateCount[3] = 0;
|
||||||
this.crossCheckStateCount[4] = 0;
|
this.crossCheckStateCount[4] = 0;
|
||||||
|
return this.crossCheckStateCount;
|
||||||
return this.crossCheckStateCount;
|
});
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.foundPatternCross=function( stateCount)
|
this.foundPatternCross=function( stateCount)
|
||||||
{
|
{
|
||||||
|
@ -395,7 +391,7 @@ function FinderPatternFinder()
|
||||||
if (startSize < 3)
|
if (startSize < 3)
|
||||||
{
|
{
|
||||||
// Couldn't find enough finder patterns
|
// 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
|
// Filter outlier possibilities whose module size is too different
|
||||||
|
@ -426,14 +422,16 @@ function FinderPatternFinder()
|
||||||
|
|
||||||
var stdDev = Math.sqrt(square / startSize - average * average);
|
var stdDev = Math.sqrt(square / startSize - average * average);
|
||||||
var limit = Math.max(0.2 * average, stdDev);
|
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];
|
var pattern = this.possibleCenters[i];
|
||||||
//if (Math.abs(pattern.EstimatedModuleSize - average) > 0.2 * average)
|
//if (Math.abs(pattern.EstimatedModuleSize - average) > 0.2 * average)
|
||||||
if (Math.abs(pattern.EstimatedModuleSize - average) > limit)
|
if (Math.abs(pattern.EstimatedModuleSize - average) > limit)
|
||||||
{
|
{
|
||||||
this.possibleCenters.remove(i);
|
//this.possibleCenters.remove(i);
|
||||||
i--;
|
this.possibleCenters.splice(i,1);
|
||||||
|
//i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -639,7 +637,7 @@ function FinderPatternFinder()
|
||||||
if (this.hasSkipped)
|
if (this.hasSkipped)
|
||||||
{
|
{
|
||||||
// Found a third one
|
// Found a third one
|
||||||
done = haveMultiplyConfirmedCenters();
|
done = this.haveMultiplyConfirmedCenters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,23 +33,17 @@ function FormatInformation(formatInfo)
|
||||||
this.errorCorrectionLevel = ErrorCorrectionLevel.forBits((formatInfo >> 3) & 0x03);
|
this.errorCorrectionLevel = ErrorCorrectionLevel.forBits((formatInfo >> 3) & 0x03);
|
||||||
this.dataMask = (formatInfo & 0x07);
|
this.dataMask = (formatInfo & 0x07);
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("ErrorCorrectionLevel", function()
|
||||||
'ErrorCorrectionLevel': {
|
{
|
||||||
get: function () {
|
return this.errorCorrectionLevel;
|
||||||
return this.errorCorrectionLevel;
|
});
|
||||||
}
|
this.__defineGetter__("DataMask", function()
|
||||||
},
|
{
|
||||||
|
return this.dataMask;
|
||||||
'DataMask': {
|
});
|
||||||
get: function () {
|
|
||||||
return this.dataMask;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.GetHashCode=function()
|
this.GetHashCode=function()
|
||||||
{
|
{
|
||||||
return (this.errorCorrectionLevel.ordinal() << 3) | dataMask;
|
return (this.errorCorrectionLevel.ordinal() << 3) | this.dataMask;
|
||||||
}
|
}
|
||||||
this.Equals=function( o)
|
this.Equals=function( o)
|
||||||
{
|
{
|
||||||
|
|
|
@ -47,20 +47,14 @@ function GF256( primitive)
|
||||||
var at1=new Array(1);at1[0]=1;
|
var at1=new Array(1);at1[0]=1;
|
||||||
this.one = new GF256Poly(this, new Array(at1));
|
this.one = new GF256Poly(this, new Array(at1));
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("Zero", function()
|
||||||
'Zero': {
|
{
|
||||||
get: function () {
|
return this.zero;
|
||||||
return this.zero;
|
});
|
||||||
}
|
this.__defineGetter__("One", function()
|
||||||
},
|
{
|
||||||
|
return this.one;
|
||||||
'One': {
|
});
|
||||||
get: function () {
|
|
||||||
return this.one;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.buildMonomial=function( degree, coefficient)
|
this.buildMonomial=function( degree, coefficient)
|
||||||
{
|
{
|
||||||
if (degree < 0)
|
if (degree < 0)
|
||||||
|
@ -69,7 +63,7 @@ function GF256( primitive)
|
||||||
}
|
}
|
||||||
if (coefficient == 0)
|
if (coefficient == 0)
|
||||||
{
|
{
|
||||||
return zero;
|
return this.zero;
|
||||||
}
|
}
|
||||||
var coefficients = new Array(degree + 1);
|
var coefficients = new Array(degree + 1);
|
||||||
for(var i=0;i<coefficients.length;i++)coefficients[i]=0;
|
for(var i=0;i<coefficients.length;i++)coefficients[i]=0;
|
||||||
|
|
|
@ -56,25 +56,18 @@ function GF256Poly(field, coefficients)
|
||||||
this.coefficients = coefficients;
|
this.coefficients = coefficients;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("Zero", function()
|
||||||
"Zero": {
|
{
|
||||||
get: function () {
|
return this.coefficients[0] == 0;
|
||||||
return this.coefficients[0] == 0;
|
});
|
||||||
}
|
this.__defineGetter__("Degree", function()
|
||||||
},
|
{
|
||||||
|
return this.coefficients.length - 1;
|
||||||
"Degree": {
|
});
|
||||||
get: function () {
|
this.__defineGetter__("Coefficients", function()
|
||||||
return this.coefficients.length - 1;
|
{
|
||||||
}
|
return this.coefficients;
|
||||||
},
|
});
|
||||||
|
|
||||||
"Coefficients": {
|
|
||||||
get: function () {
|
|
||||||
return this.coefficients;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.getCoefficient=function( degree)
|
this.getCoefficient=function( degree)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
GridSampler = {};
|
var GridSampler = {};
|
||||||
|
|
||||||
GridSampler.checkAndNudgePoints=function( image, points)
|
GridSampler.checkAndNudgePoints=function( image, points)
|
||||||
{
|
{
|
||||||
|
@ -118,12 +118,12 @@ GridSampler.sampleGrid3=function( image, dimension, transform)
|
||||||
{
|
{
|
||||||
for (var x = 0; x < max; x += 2)
|
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])];
|
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] = bit?255:0;
|
||||||
qrcode.imagedata.data[xpoint+1] = bit?255:0;
|
//qrcode.imagedata.data[xpoint+1] = bit?255:0;
|
||||||
qrcode.imagedata.data[xpoint+2] = 0;
|
//qrcode.imagedata.data[xpoint+2] = 0;
|
||||||
qrcode.imagedata.data[xpoint+3] = 255;
|
//qrcode.imagedata.data[xpoint+3] = 255;
|
||||||
//bits[x >> 1][ y]=bit;
|
//bits[x >> 1][ y]=bit;
|
||||||
if(bit)
|
if(bit)
|
||||||
bits.set_Renamed(x >> 1, y);
|
bits.set_Renamed(x >> 1, y);
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
qrcode = {};
|
var qrcode = {};
|
||||||
qrcode.imagedata = null;
|
qrcode.imagedata = null;
|
||||||
qrcode.width = 0;
|
qrcode.width = 0;
|
||||||
qrcode.height = 0;
|
qrcode.height = 0;
|
||||||
|
@ -27,12 +27,129 @@ qrcode.sizeOfDataLengthInfo = [ [ 10, 9, 8, 8 ], [ 12, 11, 16, 10 ], [ 14, 1
|
||||||
|
|
||||||
qrcode.callback = null;
|
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){
|
qrcode.decode = function(src){
|
||||||
|
|
||||||
if(arguments.length==0)
|
if(arguments.length==0)
|
||||||
{
|
{
|
||||||
var canvas_qr = document.getElementById("qr-canvas");
|
if(qrcode.canvas_qr2)
|
||||||
var context = canvas_qr.getContext('2d');
|
{
|
||||||
|
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.width = canvas_qr.width;
|
||||||
qrcode.height = canvas_qr.height;
|
qrcode.height = canvas_qr.height;
|
||||||
qrcode.imagedata = context.getImageData(0, 0, qrcode.width, qrcode.height);
|
qrcode.imagedata = context.getImageData(0, 0, qrcode.width, qrcode.height);
|
||||||
|
@ -47,6 +164,14 @@ qrcode.decode = function(src){
|
||||||
image.crossOrigin = "Anonymous";
|
image.crossOrigin = "Anonymous";
|
||||||
image.onload=function(){
|
image.onload=function(){
|
||||||
//var canvas_qr = document.getElementById("qr-canvas");
|
//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 canvas_qr = document.createElement('canvas');
|
||||||
var context = canvas_qr.getContext('2d');
|
var context = canvas_qr.getContext('2d');
|
||||||
var nheight = image.height;
|
var nheight = image.height;
|
||||||
|
@ -85,6 +210,11 @@ qrcode.decode = function(src){
|
||||||
if(qrcode.callback!=null)
|
if(qrcode.callback!=null)
|
||||||
qrcode.callback(qrcode.result);
|
qrcode.callback(qrcode.result);
|
||||||
}
|
}
|
||||||
|
image.onerror = function ()
|
||||||
|
{
|
||||||
|
if(qrcode.callback!=null)
|
||||||
|
qrcode.callback("Failed to load the image");
|
||||||
|
}
|
||||||
image.src = src;
|
image.src = src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -154,20 +284,21 @@ qrcode.process = function(ctx){
|
||||||
|
|
||||||
var qRCodeMatrix = detector.detect();
|
var qRCodeMatrix = detector.detect();
|
||||||
|
|
||||||
/*for (var y = 0; y < qRCodeMatrix.bits.Height; y++)
|
|
||||||
{
|
|
||||||
for (var x = 0; x < qRCodeMatrix.bits.Width; x++)
|
|
||||||
{
|
|
||||||
var point = (x * 4*2) + (y*2 * qrcode.width * 4);
|
|
||||||
qrcode.imagedata.data[point] = qRCodeMatrix.bits.get_Renamed(x,y)?0:0;
|
|
||||||
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)
|
if(qrcode.debug)
|
||||||
|
{
|
||||||
|
for (var y = 0; y < qRCodeMatrix.bits.Height; y++)
|
||||||
|
{
|
||||||
|
for (var x = 0; x < qRCodeMatrix.bits.Width; x++)
|
||||||
|
{
|
||||||
|
var point = (x * 4*2) + (y*2 * qrcode.width * 4);
|
||||||
|
qrcode.imagedata.data[point] = qRCodeMatrix.bits.get_Renamed(x,y)?0:0;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
ctx.putImageData(qrcode.imagedata, 0, 0);
|
ctx.putImageData(qrcode.imagedata, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(qRCodeMatrix);
|
|
||||||
|
|
||||||
var reader = Decoder.decode(qRCodeMatrix.bits);
|
var reader = Decoder.decode(qRCodeMatrix.bits);
|
||||||
var data = reader.DataByte;
|
var data = reader.DataByte;
|
||||||
|
@ -193,8 +324,8 @@ qrcode.getPixel = function(x,y){
|
||||||
if (qrcode.height < y) {
|
if (qrcode.height < y) {
|
||||||
throw "point error";
|
throw "point error";
|
||||||
}
|
}
|
||||||
point = (x * 4) + (y * qrcode.width * 4);
|
var 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 p = (qrcode.imagedata.data[point]*33 + qrcode.imagedata.data[point + 1]*34 + qrcode.imagedata.data[point + 2]*33)/100;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +402,11 @@ qrcode.grayScaleToBitmap=function(grayScale)
|
||||||
var sqrtNumArea = middle.length;
|
var sqrtNumArea = middle.length;
|
||||||
var areaWidth = Math.floor(qrcode.width / sqrtNumArea);
|
var areaWidth = Math.floor(qrcode.width / sqrtNumArea);
|
||||||
var areaHeight = Math.floor(qrcode.height / 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++)
|
for (var ay = 0; ay < sqrtNumArea; ay++)
|
||||||
{
|
{
|
||||||
|
@ -289,8 +424,12 @@ qrcode.grayScaleToBitmap=function(grayScale)
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
qrcode.grayscale = function(){
|
qrcode.grayscale = function()
|
||||||
var ret = new Array(qrcode.width*qrcode.height);
|
{
|
||||||
|
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 y = 0; y < qrcode.height; y++)
|
||||||
{
|
{
|
||||||
for (var x = 0; x < qrcode.width; x++)
|
for (var x = 0; x < qrcode.width; x++)
|
||||||
|
@ -314,9 +453,3 @@ function URShift( number, bits)
|
||||||
return (number >> bits) + (2 << ~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);
|
|
||||||
};
|
|
||||||
|
|
|
@ -36,9 +36,9 @@ function ReedSolomonDecoder(field)
|
||||||
for (var i = 0; i < twoS; i++)
|
for (var i = 0; i < twoS; i++)
|
||||||
{
|
{
|
||||||
// Thanks to sanfordsquires for this fix:
|
// Thanks to sanfordsquires for this fix:
|
||||||
var eval = poly.evaluateAt(this.field.exp(dataMatrix?i + 1:i));
|
var evalu = poly.evaluateAt(this.field.exp(dataMatrix?i + 1:i));
|
||||||
syndromeCoefficients[syndromeCoefficients.length - 1 - i] = eval;
|
syndromeCoefficients[syndromeCoefficients.length - 1 - i] = evalu;
|
||||||
if (eval != 0)
|
if (evalu != 0)
|
||||||
{
|
{
|
||||||
noError = false;
|
noError = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,59 +29,48 @@ function ECB(count, dataCodewords)
|
||||||
this.count = count;
|
this.count = count;
|
||||||
this.dataCodewords = dataCodewords;
|
this.dataCodewords = dataCodewords;
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("Count", function()
|
||||||
'Count': {
|
{
|
||||||
get: function () {
|
return this.count;
|
||||||
return this.count;
|
});
|
||||||
}
|
this.__defineGetter__("DataCodewords", function()
|
||||||
},
|
{
|
||||||
|
return this.dataCodewords;
|
||||||
'DataCodewords': {
|
});
|
||||||
get: function () {
|
|
||||||
return this.dataCodewords;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function ECBlocks( ecCodewordsPerBlock, ecBlocks1, ecBlocks2)
|
function ECBlocks( ecCodewordsPerBlock, ecBlocks1, ecBlocks2)
|
||||||
{
|
{
|
||||||
this.ecCodewordsPerBlock = ecCodewordsPerBlock;
|
this.ecCodewordsPerBlock = ecCodewordsPerBlock;
|
||||||
|
if(ecBlocks2)
|
||||||
if (ecBlocks2)
|
|
||||||
this.ecBlocks = new Array(ecBlocks1, ecBlocks2);
|
this.ecBlocks = new Array(ecBlocks1, ecBlocks2);
|
||||||
else
|
else
|
||||||
this.ecBlocks = new Array(ecBlocks1);
|
this.ecBlocks = new Array(ecBlocks1);
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("ECCodewordsPerBlock", function()
|
||||||
"ECCodewordsPerBlock": {
|
{
|
||||||
get: function () {
|
return this.ecCodewordsPerBlock;
|
||||||
return this.ecCodewordsPerBlock;
|
});
|
||||||
|
|
||||||
}
|
this.__defineGetter__("TotalECCodewords", function()
|
||||||
},
|
{
|
||||||
|
return this.ecCodewordsPerBlock * this.NumBlocks;
|
||||||
|
});
|
||||||
|
|
||||||
"TotalECCodewords": {
|
this.__defineGetter__("NumBlocks", function()
|
||||||
get: function () {
|
{
|
||||||
return this.ecCodewordsPerBlock * this.NumBlocks;
|
var total = 0;
|
||||||
}
|
for (var i = 0; i < this.ecBlocks.length; i++)
|
||||||
},
|
{
|
||||||
|
total += this.ecBlocks[i].length;
|
||||||
|
}
|
||||||
|
return total;
|
||||||
|
});
|
||||||
|
|
||||||
"NumBlocks": {
|
this.getECBlocks=function()
|
||||||
get: function () {
|
{
|
||||||
var total = 0;
|
return this.ecBlocks;
|
||||||
|
}
|
||||||
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)
|
function Version( versionNumber, alignmentPatternCenters, ecBlocks1, ecBlocks2, ecBlocks3, ecBlocks4)
|
||||||
|
@ -100,29 +89,23 @@ function Version( versionNumber, alignmentPatternCenters, ecBlocks1, ecBlocks
|
||||||
}
|
}
|
||||||
this.totalCodewords = total;
|
this.totalCodewords = total;
|
||||||
|
|
||||||
Object.defineProperties(this, {
|
this.__defineGetter__("VersionNumber", function()
|
||||||
"VersionNumber": {
|
{
|
||||||
get: function () {
|
return this.versionNumber;
|
||||||
return this.versionNumber;
|
});
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
"AlignmentPatternCenters": {
|
this.__defineGetter__("AlignmentPatternCenters", function()
|
||||||
get: function () {
|
{
|
||||||
return this.alignmentPatternCenters;
|
return this.alignmentPatternCenters;
|
||||||
}
|
});
|
||||||
},
|
this.__defineGetter__("TotalCodewords", function()
|
||||||
"TotalCodewords": {
|
{
|
||||||
get: function () {
|
return this.totalCodewords;
|
||||||
return this.totalCodewords;
|
});
|
||||||
}
|
this.__defineGetter__("DimensionForVersion", function()
|
||||||
},
|
{
|
||||||
"DimensionForVersion": {
|
return 17 + 4 * this.versionNumber;
|
||||||
get: function () {
|
});
|
||||||
return 17 + 4 * this.versionNumber;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.buildFunctionPattern=function()
|
this.buildFunctionPattern=function()
|
||||||
{
|
{
|
||||||
|
|
216
js/main.js
216
js/main.js
|
@ -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){
|
function generateTable(version){
|
||||||
qr_array = JSON.parse(JSON.stringify(qr_templates[version-1]));
|
qr_array = JSON.parse(JSON.stringify(qr_templates[version-1]));
|
||||||
changed_state = false;
|
changed_state = false;
|
||||||
|
@ -57,6 +66,11 @@ function generateTable(version){
|
||||||
updateHistory("New QR code");
|
updateHistory("New QR code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* get format information value
|
||||||
|
*
|
||||||
|
***/
|
||||||
function getInformation(size){
|
function getInformation(size){
|
||||||
//Information top-left beside Finder
|
//Information top-left beside Finder
|
||||||
for(var i=0; i < 9; i++){
|
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){
|
function generateInfoTable(position){
|
||||||
|
|
||||||
position = position || "TOP_LEFT";
|
position = position || "TOP_LEFT";
|
||||||
|
@ -134,7 +152,11 @@ function generateInfoTable(position){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Save format information value to qr_format_array
|
||||||
|
*
|
||||||
|
***/
|
||||||
function saveInfoTable(size){
|
function saveInfoTable(size){
|
||||||
for(var i=0; i < 8; i++){
|
for(var i=0; i < 8; i++){
|
||||||
if(i > 5)
|
if(i > 5)
|
||||||
|
@ -158,6 +180,11 @@ function saveInfoTable(size){
|
||||||
changed_state = true;
|
changed_state = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Reload QR table based on qr_array value
|
||||||
|
*
|
||||||
|
***/
|
||||||
function refreshTable(){
|
function refreshTable(){
|
||||||
for(var i=0; i < qr_array.length; i++){
|
for(var i=0; i < qr_array.length; i++){
|
||||||
for(var j=0; j < qr_array[i].length; j++){
|
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){
|
function updateQRArray(new_data){
|
||||||
for(var i=0; i < qr_array.length; i++){
|
for(var i=0; i < qr_array.length; i++){
|
||||||
for(var j=0; j < qr_array[i].length; j++){
|
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(){
|
function getInfoBits(){
|
||||||
var result = {ecc:"",mask:-1};
|
var result = {ecc:"",mask:-1};
|
||||||
$("#slider-mask div.active").removeClass("active");
|
$("#slider-mask div.active").removeClass("active");
|
||||||
|
@ -224,6 +281,11 @@ function getInfoBits(){
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* generate QR code made from canvas based on qr_array values
|
||||||
|
*
|
||||||
|
***/
|
||||||
function generateResult(){
|
function generateResult(){
|
||||||
|
|
||||||
var c = document.getElementById("qr-result");
|
var c = document.getElementById("qr-result");
|
||||||
|
@ -262,17 +324,32 @@ function generateResult(){
|
||||||
$("body").css("background-color","#FFFFFF");
|
$("body").css("background-color","#FFFFFF");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Update toolbox values
|
||||||
|
*
|
||||||
|
***/
|
||||||
function updateToolbox(){
|
function updateToolbox(){
|
||||||
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
|
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
|
||||||
$("#qr-size").val(qr_pixel_size+"px");
|
$("#qr-size").val(qr_pixel_size+"px");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Resize QR size
|
||||||
|
*
|
||||||
|
***/
|
||||||
function resize(size){
|
function resize(size){
|
||||||
$("td").each(function(){
|
$("td").each(function(){
|
||||||
$(this).css({"min-width":size+"px","min-height":size+"px","width":size+"px","height":size+"px"});
|
$(this).css({"min-width":size+"px","min-height":size+"px","width":size+"px","height":size+"px"});
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Toggle between Editor and Decode mode
|
||||||
|
*
|
||||||
|
***/
|
||||||
function toggleResult(){
|
function toggleResult(){
|
||||||
if(!$("#btn-switch-mode").hasClass("active")){
|
if(!$("#btn-switch-mode").hasClass("active")){
|
||||||
$(".mode-indicator button").removeClass("active");
|
$(".mode-indicator button").removeClass("active");
|
||||||
|
@ -313,6 +390,11 @@ function toggleResult(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Load image from file and put to {target}
|
||||||
|
*
|
||||||
|
***/
|
||||||
function loadImage(input, target){
|
function loadImage(input, target){
|
||||||
if(input.files && input.files[0]){
|
if(input.files && input.files[0]){
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
|
@ -324,6 +406,11 @@ function loadImage(input, target){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Save project to LocalStorage
|
||||||
|
*
|
||||||
|
***/
|
||||||
function saveProject(projectName){
|
function saveProject(projectName){
|
||||||
|
|
||||||
if(projectName == ""){
|
if(projectName == ""){
|
||||||
|
@ -354,6 +441,11 @@ function saveProject(projectName){
|
||||||
changed_state = false;
|
changed_state = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Load project from LocalStorage
|
||||||
|
*
|
||||||
|
***/
|
||||||
function loadProject(name){
|
function loadProject(name){
|
||||||
if(changed_state){
|
if(changed_state){
|
||||||
if(!confirm("Are you sure want to proceed?\nYour unsaved progress will be lost!"))
|
if(!confirm("Are you sure want to proceed?\nYour unsaved progress will be lost!"))
|
||||||
|
@ -385,6 +477,11 @@ function loadProject(name){
|
||||||
updateHistory("Load project");
|
updateHistory("Load project");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Remove project from LocalStorage
|
||||||
|
*
|
||||||
|
***/
|
||||||
function removeProject(name, origin){
|
function removeProject(name, origin){
|
||||||
if(confirm("Are you sure want to permanently delete this project?")){
|
if(confirm("Are you sure want to permanently delete this project?")){
|
||||||
var dataList = JSON.parse(localStorage.getItem("dataList"));
|
var dataList = JSON.parse(localStorage.getItem("dataList"));
|
||||||
|
@ -404,6 +501,11 @@ function removeProject(name, origin){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Refresh list of project in LocalStorage
|
||||||
|
*
|
||||||
|
***/
|
||||||
function refreshLoadList(origin){
|
function refreshLoadList(origin){
|
||||||
var dataList = JSON.parse(localStorage.getItem("dataList"));
|
var dataList = JSON.parse(localStorage.getItem("dataList"));
|
||||||
if(dataList == undefined){
|
if(dataList == undefined){
|
||||||
|
@ -417,6 +519,11 @@ function refreshLoadList(origin){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Decode Base64 to image
|
||||||
|
*
|
||||||
|
***/
|
||||||
function decodeFromBase64(img, callback){
|
function decodeFromBase64(img, callback){
|
||||||
qrcode.callback = callback;
|
qrcode.callback = callback;
|
||||||
qrcode.decode(img, callback);
|
qrcode.decode(img, callback);
|
||||||
|
@ -463,7 +570,7 @@ function importFromImage(src, cb){
|
||||||
|
|
||||||
var qrArray = qRCodeMatrix.bits.bits;
|
var qrArray = qRCodeMatrix.bits.bits;
|
||||||
var size = qRCodeMatrix.bits.width;
|
var size = qRCodeMatrix.bits.width;
|
||||||
if(size > 41){
|
if(size > 53){
|
||||||
alert("QR version is unsupported");
|
alert("QR version is unsupported");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -484,7 +591,14 @@ function importFromImage(src, cb){
|
||||||
img.src = src;
|
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){
|
function floodFill(x, y, oldVal, newVal){
|
||||||
|
|
||||||
x = parseInt(x);
|
x = parseInt(x);
|
||||||
|
@ -517,6 +631,11 @@ function floodFill(x, y, oldVal, newVal){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Update history
|
||||||
|
*
|
||||||
|
***/
|
||||||
function updateHistory(msg){
|
function updateHistory(msg){
|
||||||
|
|
||||||
if(active_history < 10) active_history++;
|
if(active_history < 10) active_history++;
|
||||||
|
@ -538,6 +657,11 @@ function updateHistory(msg){
|
||||||
$(".history").html(html);
|
$(".history").html(html);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Get history value and refresh QR table
|
||||||
|
*
|
||||||
|
***/
|
||||||
function getHistory(index){
|
function getHistory(index){
|
||||||
qr_array = JSON.parse(history_array[index][1]);
|
qr_array = JSON.parse(history_array[index][1]);
|
||||||
if(qr_array.length != qr_size){
|
if(qr_array.length != qr_size){
|
||||||
|
@ -548,6 +672,11 @@ function getHistory(index){
|
||||||
refreshTable();
|
refreshTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Clear all history value
|
||||||
|
*
|
||||||
|
***/
|
||||||
function clearHistory(){
|
function clearHistory(){
|
||||||
history_array = [];
|
history_array = [];
|
||||||
active_history = -1;
|
active_history = -1;
|
||||||
|
@ -691,6 +820,11 @@ function bruteForceFormatInfo(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Mask qr_array with mask_pattern and refresh QR table
|
||||||
|
*
|
||||||
|
***/
|
||||||
function maskDataBits(){
|
function maskDataBits(){
|
||||||
var mask_pattern = getFormatInfo(qr_array).mask;
|
var mask_pattern = getFormatInfo(qr_array).mask;
|
||||||
qr_array = maskData(qr_array, mask_pattern);
|
qr_array = maskData(qr_array, mask_pattern);
|
||||||
|
@ -787,9 +921,15 @@ function recoverPadding(){
|
||||||
qr_temp_array = Array.prototype.slice.call(result.result_array);
|
qr_temp_array = Array.prototype.slice.call(result.result_array);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
*
|
||||||
|
* Perform Reed-Solomon decode
|
||||||
|
*
|
||||||
|
***/
|
||||||
function reedSolomonDecode(data, nysm){
|
function reedSolomonDecode(data, nysm){
|
||||||
|
|
||||||
var result = [];
|
var result = [];
|
||||||
|
//console.log('nysm: '+nysm, 'data: '+data);
|
||||||
|
|
||||||
for(var i=0; i < data.length; i++){
|
for(var i=0; i < data.length; i++){
|
||||||
var err_pos = [];
|
var err_pos = [];
|
||||||
|
@ -1155,6 +1295,12 @@ function updateBlock(value, cls){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
*
|
||||||
|
* EVENT LISTENER USING JQUERY
|
||||||
|
*
|
||||||
|
********************************************************************/
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
|
||||||
|
@ -1308,7 +1454,7 @@ $(document).ready(function(){
|
||||||
$("#btn-version-plus").click(function(){
|
$("#btn-version-plus").click(function(){
|
||||||
if(changed_state){
|
if(changed_state){
|
||||||
if(confirm("Are you sure want to proceed?\nYour unsaved progress will be lost!")){
|
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_version += 1;
|
||||||
qr_size = 17+(qr_version*4);
|
qr_size = 17+(qr_version*4);
|
||||||
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
|
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
|
||||||
|
@ -1316,7 +1462,7 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(qr_version != 6){
|
if(qr_version != 9){
|
||||||
qr_version += 1;
|
qr_version += 1;
|
||||||
qr_size = 17+(qr_version*4);
|
qr_size = 17+(qr_version*4);
|
||||||
$("#qr-version").val(qr_size+"x"+qr_size+" (ver. "+qr_version+")");
|
$("#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(){
|
$("#mobile-editor-mode, #mobile-decode-mode").click(function(){
|
||||||
toggleResult();
|
toggleResult();
|
||||||
|
|
|
@ -433,6 +433,8 @@ function rs_forney_syndromes(synd, pos, nmess){
|
||||||
|
|
||||||
function rs_correct_msg(msg_in, nysm, erase_pos){
|
function rs_correct_msg(msg_in, nysm, erase_pos){
|
||||||
|
|
||||||
|
console.log(msg_in);
|
||||||
|
|
||||||
erase_pos = erase_pos || undefined;
|
erase_pos = erase_pos || undefined;
|
||||||
|
|
||||||
var msg_len = msg_in.length - nysm;
|
var msg_len = msg_in.length - nysm;
|
||||||
|
|
15
js/sqrd.js
15
js/sqrd.js
|
@ -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;
|
return is_data_module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -905,7 +918,7 @@ function QRDecode(data){
|
||||||
//TODO: Kanji mode
|
//TODO: Kanji mode
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
console.log("[ERROR]: Invalid Encoding mode");
|
console.log("[ERROR]: Invalid Encoding mode", mode);
|
||||||
result.error.push("Invalid Encoding mode");
|
result.error.push("Invalid Encoding mode");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
216
js/table.js
216
js/table.js
|
@ -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 = {
|
var function_pattern_with_format_info = {
|
||||||
/*
|
/*
|
||||||
0 : white
|
0 : white
|
||||||
|
@ -53,7 +53,10 @@ var alignment_pattern_array = [
|
||||||
[6, 22],
|
[6, 22],
|
||||||
[6, 26],
|
[6, 26],
|
||||||
[6, 30],
|
[6, 30],
|
||||||
[6, 34]
|
[6, 34],
|
||||||
|
[6, 22, 38],
|
||||||
|
[6, 24, 42],
|
||||||
|
[6, 26, 46]
|
||||||
];
|
];
|
||||||
|
|
||||||
var format_information_bits_raw = {
|
var format_information_bits_raw = {
|
||||||
|
@ -226,13 +229,23 @@ var format_information_unmask = [
|
||||||
'111111111111111'
|
'111111111111111'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//Version information table for QR version 7 and higher
|
||||||
|
var version_information_table = [
|
||||||
|
000111110010010100,
|
||||||
|
001000010110111100,
|
||||||
|
001001101010011001
|
||||||
|
]
|
||||||
|
|
||||||
var data_code_num_table = [
|
var data_code_num_table = [
|
||||||
[ 16, 19, 9, 13],
|
[ 16, 19, 9, 13],
|
||||||
[ 28, 34, 16, 22],
|
[ 28, 34, 16, 22],
|
||||||
[ 44, 55, 26, 34],
|
[ 44, 55, 26, 34],
|
||||||
[ 64, 80, 36, 48],
|
[ 64, 80, 36, 48],
|
||||||
[ 86, 108, 46, 62],
|
[ 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 = [
|
var RS_block_num_table = [
|
||||||
|
@ -241,7 +254,10 @@ var RS_block_num_table = [
|
||||||
[1, 1, 2, 2],
|
[1, 1, 2, 2],
|
||||||
[2, 1, 4, 2],
|
[2, 1, 4, 2],
|
||||||
[2, 1, 4, 4],
|
[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 = [
|
var alphanumeric_table = [
|
||||||
|
@ -261,14 +277,17 @@ var error_correction_code_table = [
|
||||||
[26,15,22,18],
|
[26,15,22,18],
|
||||||
[18,20,16,26],
|
[18,20,16,26],
|
||||||
[24,26,22,18],
|
[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
|
0 : white
|
||||||
1 : black
|
1 : black
|
||||||
|
@ -277,6 +296,9 @@ var remainder_bits_table = [0,7,7,7,7,7];
|
||||||
*************************************************************/
|
*************************************************************/
|
||||||
var qr_templates = [
|
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,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,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],
|
[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,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,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],
|
[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,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,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],
|
[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,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,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],
|
[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,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,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],
|
[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 = [
|
||||||
],
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file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
sample/qr-v7-damaged.png
Normal file
BIN
sample/qr-v7-damaged.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Loading…
Add table
Reference in a new issue