MCPcopy Index your code
hub / github.com/clips/pattern / bump

Function bump

pattern/canvas.js:3375–3387  ·  view source on GitHub ↗
(img, dx, dy, radius, zoom)

Source from the content-addressed store, hash-verified

3373}
3374
3375function bump(img, dx, dy, radius, zoom) {
3376 /* Returns the image with a dent distortion applied to it.
3377 * - dx: horizontal offset (in pixels) of the effect.
3378 * - dy: vertical offset (in pixels) of the effect.
3379 * - radius: the radius of the effect in pixels.
3380 * - zoom: the amount of bulge (0.0-1.0).
3381 */
3382 var m1 = radius || 0;
3383 var m2 = Math.clamp(zoom || 0, 0, 1);
3384 return polar(img, dx, dy, function(d, a) {
3385 return [d * geometry.smoothstep(0, m2, d/m1), a];
3386 });
3387}
3388
3389function dent(img, dx, dy, radius, zoom) {
3390 /* Returns the image with a dent distortion applied to it.

Callers 1

distortFunction · 0.85

Calls 1

polarFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…