|
|
@@ -1793,7 +1793,41 @@ class GRAUZONE extends Shader { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
|
|
|
|
COPYZOOM |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
class COPYZOOM extends Shader { |
|
|
|
int coprx, copry, coprw, coprh; |
|
|
|
PImage buffer; |
|
|
|
COPYZOOM() { |
|
|
|
name = "fxCopyZoom"; |
|
|
|
params.add(new Param("w", FLOATVAL, 0, 1, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
params.add(new Param("h", FLOATVAL, 0, 1, new int[]{SAWTOOTH, TRIANG, SINE, TAN, TANINVERSE, RAMPUPDOWN, RAMP, RAMPINVERSE})); |
|
|
|
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})); |
|
|
|
buffer = createImage(renderer.width, renderer.height, ARGB); |
|
|
|
|
|
|
|
coprw = int(random(0, renderer.width)); |
|
|
|
coprh = int(random(0, renderer.height)); |
|
|
|
coprx = int(random(0, renderer.width-coprw)); |
|
|
|
copry = int(random(0, renderer.height-coprh)); |
|
|
|
} |
|
|
|
void apply() { |
|
|
|
if (buffer.width != renderer.width || buffer.height != renderer.height) buffer.resize(renderer.width, renderer.height); |
|
|
|
buffer = renderer.get(); |
|
|
|
coprw = int(map(params.get(0).value, 0, 1, 1, renderer.width)); |
|
|
|
coprh = int(map(params.get(1).value, 0, 1, 1, renderer.height)); |
|
|
|
coprx = int(map(params.get(2).value, 0, 1, 0, renderer.width-coprw)); |
|
|
|
copry = int(map(params.get(3).value, 0, 1, 0, renderer.height-coprh)); |
|
|
|
renderer.beginDraw(); |
|
|
|
buffer.copy(coprx, copry, coprw, coprh, 0, 0, renderer.width, renderer.height); |
|
|
|
renderer.image(buffer, 0, 0, renderer.width, renderer.height); |
|
|
|
renderer.endDraw(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
|