зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1152836 - QR Decoder: Remove getPixel bounds check: 400ms -> 335ms r=past
This commit is contained in:
Родитель
de8bc0d619
Коммит
9d5ffcbf12
|
@ -1476,12 +1476,6 @@ qrcode.process = function(ctx) {
|
|||
};
|
||||
|
||||
qrcode.getPixel = function(x, y) {
|
||||
if (imgWidth < x) {
|
||||
throw "point error";
|
||||
}
|
||||
if (imgHeight < y) {
|
||||
throw "point error";
|
||||
}
|
||||
let point = x * 4 + y * imgWidth * 4;
|
||||
let p = (imagedata[point] * 33 + imagedata[point + 1] * 34 + imagedata[point + 2] * 33) / 100;
|
||||
return p;
|
||||
|
|
Загрузка…
Ссылка в новой задаче