function draw(p) {
let line = 0;
return () => {
const img = mutable image;
const w = img.width;
const h = img.height;
line += 1;
if (line == h) {
line = 0;
}
img.loadPixels();
for (let i = 0; i < w * 4; i++) {
const tmp = img.pixels[line * w * 4 + i];
img.pixels[line * w * 4 + i] = img.pixels[(h - line) * w * 4 + i];
img.pixels[(h - line) * w * 4 + i] = tmp;
}
img.updatePixels();
p.image(img, 0, 0);
mutable Output = `${w} - ${h} - ${line}`;
};
}