@@ -0,0 +1,1305 @@
+package com.haxademic.demo.draw.image;%0A%0Aimport com.haxademic.core.app.P;%0Aimport com.haxademic.core.app.PAppletHax;%0Aimport com.haxademic.core.draw.image.ImageUtil;%0Aimport com.haxademic.core.file.DemoAssets;%0A%0Aimport processing.core.PGraphics;%0Aimport processing.core.PImage;%0A%0Apublic class Demo_BlurByTextureTransfer %0Aextends PAppletHax %7B%0A%09public static void main(String args%5B%5D) %7B PAppletHax.main(Thread.currentThread().getStackTrace()%5B1%5D.getClassName()); %7D%0A%0A%09protected PImage sourceImg;%0A%09protected PGraphics copySmallBuffer;%0A%09protected PGraphics copyBackBuffer;%0A%0A%09public void setupFirstFrame() %7B%0A%09%09// prep buffers%0A%09%09sourceImg = DemoAssets.smallTexture();%0A%09%09float scaleDown = 0.2f;%0A%09%09copySmallBuffer = p.createGraphics(P.round(sourceImg.width * scaleDown), P.round(sourceImg.height * scaleDown), P.P3D);%0A%09%09copyBackBuffer = p.createGraphics(sourceImg.width, sourceImg.height, P.P3D);%0A%0A%09%09// copy image down and back up for blur%0A%09%09ImageUtil.copyImage(sourceImg, copySmallBuffer);%0A%09%09ImageUtil.copyImage(copySmallBuffer, copyBackBuffer);%0A%09%09%0A%09%7D%0A%0A%09public void drawApp() %7B%0A%09%09// set up context%0A%09%09p.background(100);%0A%09%09p.noStroke();%0A%0A%09%09// draw steps/results to screen%0A%09%09p.image(sourceImg, 0, 0);%0A%09%09p.image(copySmallBuffer, sourceImg.width, 0);%0A%09%09p.image(copyBackBuffer, sourceImg.width + copySmallBuffer.width, 0);%0A%09%7D%0A%7D%0A

Test blur effect by texture resampling