summaryrefslogtreecommitdiff
path: root/Year_2/IandM/maximum/maximum.pde
diff options
context:
space:
mode:
Diffstat (limited to 'Year_2/IandM/maximum/maximum.pde')
-rw-r--r--Year_2/IandM/maximum/maximum.pde15
1 files changed, 14 insertions, 1 deletions
diff --git a/Year_2/IandM/maximum/maximum.pde b/Year_2/IandM/maximum/maximum.pde
index 4f0f54f..69d69db 100644
--- a/Year_2/IandM/maximum/maximum.pde
+++ b/Year_2/IandM/maximum/maximum.pde
@@ -1,11 +1,24 @@
+int k = 1;
+
void setup() {
size(512, 256);
+}
+
+void draw() {
PImage img = loadImage("lena.png");
img.resize(256, 256);
img.filter(GRAY);
image(img, 0, 0);
- image(maximum(img, 11), 256, 0);
+ image(maximum(img, k), 256, 0);
+}
+
+void keyPressed() {
+ if (key == '+') {
+ k++;
+ } else if (key == '-') {
+ k--;
+ }
}
PImage maximum(PImage I, int n) {