MCPcopy
hub / github.com/processing/p5.js / blend

Method blend

src/image/p5.Image.js:1362–1371  ·  view source on GitHub ↗

* @param {Integer} sx * @param {Integer} sy * @param {Integer} sw * @param {Integer} sh * @param {Integer} dx * @param {Integer} dy * @param {Integer} dw * @param {Integer} dh * @param {(BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD

(...args)

Source from the content-addressed store, hash-verified

1360 * @param {(BLEND|DARKEST|LIGHTEST|DIFFERENCE|MULTIPLY|EXCLUSION|SCREEN|REPLACE|OVERLAY|HARD_LIGHT|SOFT_LIGHT|DODGE|BURN|ADD|NORMAL)} blendMode
1361 */
1362 blend(...args) {
1363 const currBlend = this.drawingContext.globalCompositeOperation;
1364 const blendMode = args[args.length - 1];
1365 const copyArgs = Array.prototype.slice.call(args, 0, args.length - 1);
1366
1367 this.drawingContext.globalCompositeOperation = blendMode;
1368 this.copy(...copyArgs);
1369 this.drawingContext.globalCompositeOperation = currBlend;
1370 this.setModified(true);
1371 }
1372
1373 /**
1374 * helper method for web GL mode to indicate that an image has been

Callers 3

setupFunction · 0.45
pixels.jsFile · 0.45
pixelsFunction · 0.45

Calls 2

copyMethod · 0.95
setModifiedMethod · 0.95

Tested by

no test coverage detected