(idata, x, y)
| 4701 | })();;(function() { |
| 4702 | |
| 4703 | function pixelAt(idata, x, y) { |
| 4704 | var idx = (y * idata.width + x) * 4; |
| 4705 | var d = []; |
| 4706 | d.push(idata.data[idx++], idata.data[idx++], idata.data[idx++], idata.data[idx++]); |
| 4707 | return d; |
| 4708 | } |
| 4709 | |
| 4710 | function rgbDistance(p1, p2) { |
| 4711 | return Math.sqrt(Math.pow(p1[0] - p2[0], 2) + Math.pow(p1[1] - p2[1], 2) + Math.pow(p1[2] - p2[2], 2)); |