Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente | Prochaine révision Les deux révisions suivantes | ||
recherche:residence_corruption:corruption_litteraire [2019/10/01 18:15] gweltaz [Le sketch Processing de présentation] |
recherche:residence_corruption:corruption_litteraire [2019/10/01 18:18] gweltaz [Le sketch Processing de présentation] |
||
---|---|---|---|
Ligne 162: | Ligne 162: | ||
===== Le sketch Processing de présentation ===== | ===== Le sketch Processing de présentation ===== | ||
+ | |||
<accordion> | <accordion> | ||
+ | <panel title="glitching d'inversion de couleurs (cliquer pour afficher le code)"> | ||
+ | <code java> | ||
+ | void glitchScreen(int n) { | ||
+ | loadPixels(); | ||
+ | for (int i=0; i<n; i++) { | ||
+ | int x0 = (int) random(width); | ||
+ | int y0 = (int) random(height); | ||
+ | int x1 = (int) min(x0+random(4, 100*12*corruptionLevel), width); | ||
+ | int y1 = (int) min(y0+random(4, 10+4*corruptionLevel), height); | ||
+ | for (int y=y0; y<y1; y++) { | ||
+ | for (int x=x0; x<x1; x++) { | ||
+ | pixels[x + y*width] = ~pixels[x + y*width]; | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | updatePixels(); | ||
+ | } | ||
+ | </code> | ||
+ | </panel> | ||
+ | </accordion> |