Comparing version
10
index.js
@@ -73,3 +73,3 @@ // jshint esversion: 6, globalstrict: true, strict: true | ||
name: region.name, | ||
containsPoint: polygonPoints.containsPoint.bind(polygonPoints), | ||
polygon: polygonPoints, | ||
pointsLength: polygonPoints.pointsLength(), | ||
@@ -141,3 +141,3 @@ difference: this._validateNumber(parseInt(region.difference), this._difference, 1, 255), | ||
for (let j = 0; j < this._regionsLength; j++) { | ||
if (this._regions[j].containsPoint([x,y]) === true) { | ||
if (this._regions[j].polygon.containsPoint({x: x, y: y}) === true) { | ||
if (this._oldPix[i] !== this._newPix[i]) { | ||
@@ -184,3 +184,3 @@ this._regions[j].diffs++; | ||
for (let j = 0; j < this._regionsLength; j++) { | ||
if (this._regions[j].containsPoint([x,y]) === true) { | ||
if (this._regions[j].polygon.containsPoint({x: x, y: y}) === true) { | ||
if (Math.abs(this._oldPix[i] - this._newPix[i]) >= this._regions[j].difference) { | ||
@@ -227,3 +227,3 @@ this._regions[j].diffs++; | ||
for (let j = 0; j < this._regionsLength; j++) { | ||
if (this._regions[j].containsPoint([x,y]) === true) { | ||
if (this._regions[j].polygon.containsPoint({x: x, y: y}) === true) { | ||
if (Math.abs(this._grayscale(this._oldPix[i], this._oldPix[i + 1], this._oldPix[i + 2]) - this._grayscale(this._newPix[i], this._newPix[i + 1], this._newPix[i + 2])) >= this._regions[j].difference) { | ||
@@ -270,3 +270,3 @@ this._regions[j].diffs++; | ||
for (let j = 0; j < this._regionsLength; j++) { | ||
if (this._regions[j].containsPoint([x,y]) === true) { | ||
if (this._regions[j].polygon.containsPoint({x: x, y: y}) === true) { | ||
if (Math.abs(this._grayscale(this._oldPix[i], this._oldPix[i + 1], this._oldPix[i + 2]) - this._grayscale(this._newPix[i], this._newPix[i + 1], this._newPix[i + 2])) >= this._regions[j].difference) { | ||
@@ -273,0 +273,0 @@ this._regions[j].diffs++; |
{ | ||
"name": "pam-diff", | ||
"version": "0.4.10", | ||
"version": "0.5.0", | ||
"description": "Measure differences between pixel arrays extracted from pam images", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"polygon-points": "^0.1.7" | ||
"polygon-points": "^0.2.0" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
19217
0.1%+ Added
- Removed
Updated