Hi,
I'm asking you for help with my program.
Program is applying a blur filter to an image.
It reads numeric keys from '0' to '5' and apply blur with level equal to the value of choosen number (0 - 5).
Now, the blur filter always modify source image and then next blur is applied to blured image.
I would like to always blur fresh original image...
here is example:
Code:
PImage img;
void setup() {
size(256,256);
img = loadImage("image.bmp");
img.loadPixels();
}
void draw() {
}
void blur(PImage imageb, int threshold) {
imageb.filter(BLUR, threshold);
image(imageb, 0, 0);
}
void keyPressed() {
if(key == '0') blur(img, 0);
if(key == '1') blur(img, 1);
if(key == '2') blur(img, 2);
if(key == '3') blur(img, 3);
if(key == '4') blur(img, 4);
if(key == '5') blur(img, 5);
redraw();
}
How to make it works ?
Everytime the blur(); function is called i want to modify source image with current ammount of blur.
PLEASE HELP