MCPcopy
hub / github.com/ericdrowell/KineticJS / pixelAt

Function pixelAt

kinetic.js:4703–4708  ·  view source on GitHub ↗
(idata, x, y)

Source from the content-addressed store, hash-verified

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));

Callers 1

backgroundMaskFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected