int[][] p; int[][] tastpic; void setup() { p = load("comic.gif"); tastpic = p; size(725,645); PFont font; font = loadFont("Verdana-20.vlw"); textFont(font,15); fill(000,000,000); } // end void setup void draw(){ background(255,70,40); text("TASTE 1 - schwarzerBalken",460,105); text("TASTE 2 - horizontalSpiegeln",460,125); text("TASTE 3 - vertikal Spiegeln",460,145); text("TASTE 4 - verkleinern",460,165); text("TASTE 5 - schwarzerKreis",460,185); text("TASTE 6 - weisser Rand",460,205); text("TASTE 7 - blockweiseVerschieben",460,225); int[][] balken = balken(p); int[][] horizontal = horizontal(p); int[][] vertikal = vertikal(p); int[][] verklei = verklei(p); int[][] kreis = kreis(p); int[][] weiss = weiss(p); int[][] blockweise = blockweise(p); show(p,15,15); show(tastpic, 15,330); } // TASTENBEFEHLE DEKLARIEREN -------------------------------------------------------- void keyPressed(){ if(key == '1'){ tastpic = balken(p);} if(key == '2'){ tastpic = horizontal(p);} if(key == '3'){ tastpic = vertikal(p);} if(key == '4'){ tastpic = verklei(p);} if(key == '5'){ tastpic = kreis(p);} if(key == '6'){ tastpic = weiss(p);} if(key == '7'){ tastpic = blockweise(p);} } // END TASTENBEFEHLE DEKLARIEREN -------------------------------------------------------- // schwarzerBalken ---------------------------------------------------------------- int [][] balken(int[][]p){ int[][]schwarzbalken = new int [p.length][p[0].length]; for (int spalte = 0; spalte < p.length;spalte++){ for (int zeile = 0; zeile < p[0].length;zeile++){ schwarzbalken[spalte][zeile] = p[spalte][zeile]; if(zeile
p.length-15 || zeile < 15 || zeile > p[zeile].length-20) weisserRand[spalte][zeile] = 0xFFFFFFFF; else weisserRand[spalte][zeile] = p[spalte][zeile]; } } return weisserRand; }// end weisser Rand --------------------------------------------------------------- // blockweiseVerschieben ----------------------------------------------------------- int [][] blockweise(int[][]p){ int[][]blockweiseVerschieben = new int [p.length][p[0].length]; for (int spalte = 0; spalte < p.length;spalte++){ for (int zeile = 0; zeile < p[0].length;zeile++){ blockweiseVerschieben[spalte][zeile] = p[(spalte+60)%p.length][zeile]; } } return blockweiseVerschieben; }// end blockweiseVerschieben -----------------------------------------------------