|
|
@@ -1575,7 +1575,7 @@ class BRIGHTER extends Shader { |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
AMPLIFY |
|
|
|
AMPLIFY |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
@@ -1588,19 +1588,21 @@ class AMPLIFY extends Shader { |
|
|
|
name = "fxAmplify"; |
|
|
|
params.add(new Param("hue / red", FLOATVAL, -255, 255, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("saturation / green", FLOATVAL, -255, 255, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("brightness / blue", FLOATVAL, -255,255, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("brightness / blue", FLOATVAL, -255, 255, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("RGB / HSB", INTVAL, 0, 1, new int[]{SQUAR, RANDOM})); |
|
|
|
} |
|
|
|
void apply() { |
|
|
|
renderer.beginDraw(); |
|
|
|
if(params.get(3).value > 0) colorMode(HSB); |
|
|
|
else { colorMode(RGB); } |
|
|
|
if (params.get(3).value > 0) colorMode(HSB); |
|
|
|
else { |
|
|
|
colorMode(RGB); |
|
|
|
} |
|
|
|
renderer.loadPixels(); |
|
|
|
for (int i = 0; i < renderer.width*renderer.height; i++) { |
|
|
|
float h = hue(renderer.pixels[i]); |
|
|
|
float s = saturation(renderer.pixels[i]); |
|
|
|
float b = brightness(renderer.pixels[i]); |
|
|
|
renderer.pixels[i] = color(h+params.get(0).value,s+params.get(1).value,b+params.get(2).value); |
|
|
|
renderer.pixels[i] = color(h+params.get(0).value, s+params.get(1).value, b+params.get(2).value); |
|
|
|
} |
|
|
|
renderer.updatePixels(); |
|
|
|
renderer.endDraw(); |
|
|
@@ -1623,41 +1625,63 @@ class BROKENCOLORROT extends Shader { |
|
|
|
} |
|
|
|
void apply() { |
|
|
|
renderer.beginDraw(); |
|
|
|
if(params.get(3).value > 0) colorMode(HSB); |
|
|
|
else { colorMode(RGB); } |
|
|
|
if (params.get(3).value > 0) colorMode(HSB); |
|
|
|
else { |
|
|
|
colorMode(RGB); |
|
|
|
} |
|
|
|
renderer.loadPixels(); |
|
|
|
float h = params.get(0).value; |
|
|
|
float s = params.get(1).value; |
|
|
|
float b = params.get(2).value; |
|
|
|
for (int i = 0; i < renderer.width*renderer.height; i++) { |
|
|
|
h = hue(renderer.pixels[i])+h; |
|
|
|
if(h > 255) h -= 255; |
|
|
|
if (h > 255) h -= 255; |
|
|
|
s = saturation(renderer.pixels[i])+s; |
|
|
|
if(s > 255) s -= 255; |
|
|
|
if (s > 255) s -= 255; |
|
|
|
b = brightness(renderer.pixels[i])+b; |
|
|
|
if(b > 255) b -= 255; |
|
|
|
if (b > 255) b -= 255; |
|
|
|
renderer.pixels[i] = color(h, s, b); |
|
|
|
} |
|
|
|
renderer.updatePixels(); |
|
|
|
renderer.endDraw(); |
|
|
|
colorMode(RGB); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
BUFFER |
|
|
|
POSTERIZE |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
*/ |
|
|
|
class POSTER extends Shader { |
|
|
|
|
|
|
|
class BUFFER extends Shader{ |
|
|
|
BUFFER(){ |
|
|
|
name = "BUFFER"; |
|
|
|
POSTER() { |
|
|
|
name = "fxPosterize"; |
|
|
|
params.add(new Param("levels", INTVAL, 2, 10, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
} |
|
|
|
void apply() { |
|
|
|
renderer.beginDraw(); |
|
|
|
//renderer.loadPixels(); |
|
|
|
renderer.filter(POSTERIZE, (int)params.get(0).value); |
|
|
|
//renderer.updatePixels(); |
|
|
|
renderer.endDraw(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
BUFFER |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
class BUFFER extends Shader { |
|
|
|
BUFFER() { |
|
|
|
name = "BUFFER"; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@@ -1687,8 +1711,8 @@ class BUFFER extends Shader{ |
|
|
|
// name |
|
|
|
String getColorspaceName(int cs) { |
|
|
|
switch(cs) { |
|
|
|
case OHTA: |
|
|
|
return "OHTA"; |
|
|
|
case OHTA: |
|
|
|
return "OHTA"; |
|
|
|
case CMY: |
|
|
|
return "CMY"; |
|
|
|
case XYZ: |