From 003d4f837c9a0839d873d765f5c3bdf654a83a41 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 23 Jul 2022 04:49:55 +0200 Subject: [PATCH] added fxWrongQSort --- data/saves.sav | 2 +- effects.pde | 110 ++++++++++++++++++++++++++++++++++++++++++ statics_and_lists.pde | 8 ++- 3 files changed, 118 insertions(+), 2 deletions(-) diff --git a/data/saves.sav b/data/saves.sav index 982d352..031ee58 100755 --- a/data/saves.sav +++ b/data/saves.sav @@ -1,2 +1,2 @@ //globals -uptime = 116775809 +uptime = 116778844 diff --git a/effects.pde b/effects.pde index 380ed1a..338d93f 100644 --- a/effects.pde +++ b/effects.pde @@ -2715,6 +2715,116 @@ class DRIPDRIP extends Shader { } } +/* + + WRONGQSORT + + */ + +class WRONGQSORT extends Shader { + int max_display_size = 800; // viewing window size (regardless image size) + + boolean mode = L; // L or R, which sort part is broken + + boolean do_blend = false; // blend image after process + int blend_mode = OVERLAY; // blend type + + static final boolean L = true; + static final boolean R = false; + + // working buffer + PGraphics buffer; + + // image + PImage img; + + float random_point = 0.5; + int len; + + //bei mausmove + WRONGQSORT() { + name = "fxWrongQSort"; + params.add(new Param ("x", FLOATVAL, 0, 1, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); + params.add(new Param ("y", FLOATVAL, 0, 1, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); + params.add(new Param ("randomize", FLOATVAL, 0.1, 0.9, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); + params.add(new Param ("direction", INTVAL, 0, 3, new int[]{RANDOM})); + directionParamIndex = 3; + /* + buffer = createGraphics(canvas.width, canvas.height); + buffer.beginDraw(); + buffer.noStroke(); + buffer.smooth(8); + buffer.background(0); + buffer.image(img, 0, 0); + buffer.endDraw(); + */ + } + + void apply() { + float x = params.get(0).value; + float y = params.get(1).value; + int v = (int)map(x*y, 0, 1, 1, len-1); + random_point = params.get(2).value; + + + canvas.beginDraw(); + canvas.image(img, 0, 0); + canvas.endDraw(); + + canvas.loadPixels(); + int x = 0; + while (x pivot) { + j--; + } + if (i <= j) { + temp = x[i]; + x[i] = x [j]; + x[j] = temp; + i++; + j--; + } + } + return i; + } + + + void quicksort(int x[], int left, int right) { + if (left index-1) quicksort(x, left, index-1); + if (right > index) quicksort(x, index, right); + } + } + } +} diff --git a/statics_and_lists.pde b/statics_and_lists.pde index 8ad8bf4..a065924 100644 --- a/statics_and_lists.pde +++ b/statics_and_lists.pde @@ -20,6 +20,11 @@ final static int RAMPINVERSE = 8; //line for half the sequence up to 1, then sta final static int RAMPUPDOWN = 9; //line up, stay, line down, stay final static int RANDOM = 10; + +// FLAGS, ALGORITHMS and EASING mathod by sulej for ultimate sort + + + //colorspaces from tomasz sulej's FM effect final static int COLORSPACES = 16; @@ -67,5 +72,6 @@ String availableFx[] = { "fxDrawStrokes", "fxDrawGenerative", "fxPixelDrifter", - "fxDripDrip" + "fxDripDrip", + "fxWrongQSort" };