lenseImage.loadPixels(); for (int y = 0; y < lenseImage.height; y++) { for (int x = 0; x < lenseImage.width; x++) { int index = y + x * lenseImage.width; float d = PApplet.dist(x, y, radius, radius); if (d > radius) { lenseImage.pixels[index] = 0; } else if (d >= radius - feather) { int c = temp.pixels[index]; int r = (c >> 16) & 0xff; int g = (c >> 8) & 0xff; int b = (c) & 0xff; c = parent.color(r, g, b, PApplet.map(d, radius, radius, 255, 0)); lenseImage.pixels[index] = c; } else { lenseImage.pixels[index] = temp.pixels[index]; } } } lenseImage.updatePixels();
return lenseImage; }
now i get the lens:
PImage lenseImage = lensOver(radius, feather);
now how can i scale the image behind the lens without scaling the lens?