MCPcopy
hub / github.com/methodofaction/Method-Draw / blur

Function blur

src/js/lib/canvg.js:2374–2384  ·  view source on GitHub ↗
(ctx, width, height, sigma)

Source from the content-addressed store, hash-verified

2372 }
2373
2374 function blur(ctx, width, height, sigma)
2375 {
2376 var srcData = ctx.getImageData(0, 0, width, height);
2377 var mask = make_fgauss(sigma);
2378 mask = normalize(mask);
2379 tmp = [];
2380 convolve_even(srcData.data, tmp, mask, width, height);
2381 convolve_even(tmp, srcData.data, mask, height, width);
2382 ctx.clearRect(0, 0, width, height);
2383 ctx.putImageData(srcData, 0, 0);
2384 }
2385
2386 this.apply = function(ctx, x, y, width, height) {
2387 // assuming x==0 && y==0 for now

Callers 1

buildFunction · 0.70

Calls 3

make_fgaussFunction · 0.85
normalizeFunction · 0.85
convolve_evenFunction · 0.85

Tested by

no test coverage detected