MCPcopy Index your code
hub / github.com/processing/p5.js / getFilteredPixels

Function getFilteredPixels

test/unit/webgl/p5.RendererGL.js:630–647  ·  view source on GitHub ↗
(mode, initialize, filterType)

Source from the content-addressed store, hash-verified

628 ];
629
630 const getFilteredPixels = (mode, initialize, filterType) => {
631 myp5.createCanvas(10, 10, mode === 'p2d' ? myp5.P2D : myp5.WEBGL);
632 myp5.pixelDensity(1);
633 myp5.background(255);
634 if (mode === 'webgl') {
635 myp5.translate(-5, -5);
636 }
637 myp5.noStroke();
638 myp5.fill(255, 0, 0);
639 myp5.rectMode(myp5.CORNER);
640 myp5.rect(3, 3, 4, 4);
641 initialize();
642 myp5.filter(filterType);
643 myp5.loadPixels();
644 const pixels = [...myp5.pixels];
645 myp5.remove();
646 return pixels;
647 };
648
649 for (const filterType of ['blur', 'invert']) {
650 suite(`${filterType} filter`, function() {

Callers 1

p5.RendererGL.jsFile · 0.85

Calls 10

initializeFunction · 0.85
noStrokeMethod · 0.80
pixelDensityMethod · 0.45
backgroundMethod · 0.45
translateMethod · 0.45
fillMethod · 0.45
rectMethod · 0.45
filterMethod · 0.45
loadPixelsMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected