Browse Source

added fxCopyZoom

master
Victor Giers 1 year ago
parent
commit
297f761a76
3 changed files with 43 additions and 6 deletions
  1. 34
    0
      effects.pde
  2. 8
    5
      secondapplet.pde
  3. 1
    1
      statics_and_lists.pde

+ 34
- 0
effects.pde View File

} }
} }


/*

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();
}
}


/* /*



+ 8
- 5
secondapplet.pde View File

.setSize(15, 15) .setSize(15, 15)
.plugTo(this, "CP5_pauseAllAction"); .plugTo(this, "CP5_pauseAllAction");
pauseAll.getCaptionLabel().getStyle().setMargin(-17, 0, 0, 20); pauseAll.getCaptionLabel().getStyle().setMargin(-17, 0, 0, 20);
Bang nativeReso = cp5.addBang("native reso") Bang nativeReso = cp5.addBang("native reso")
.setPosition(220,height-35)
.setSize(15,15)
.setPosition(220, height-35)
.setSize(15, 15)
.plugTo(this, "CP5_nativeResoAction"); .plugTo(this, "CP5_nativeResoAction");
//nativeReso.getCaptionLabel().getStyle().setMargin(-17,0,0,20); //nativeReso.getCaptionLabel().getStyle().setMargin(-17,0,0,20);


totalBrickHeight+= bricks.get(i).h; totalBrickHeight+= bricks.get(i).h;
} }
popMatrix(); popMatrix();
if(heightOverLimit){
if (heightOverLimit) {
strokeWeight(3); strokeWeight(3);
fill(255); fill(255);
line(width-5,-scrollAmount+4,width-5,height-120+(maxSurfaceHeight-120-totalBrickHeight)-scrollAmount-4);
line(width-5, -scrollAmount+4, width-5, height-120+(maxSurfaceHeight-120-totalBrickHeight)-scrollAmount-4);
//-scrollAmount + (-1*(maxSurfaceHeight-120-totalBrickHeight))); //-scrollAmount + (-1*(maxSurfaceHeight-120-totalBrickHeight)));
} }
fill(68, 68, 68); fill(68, 68, 68);
case(15): case(15):
shaderManager.addShader(new GRAUZONE()); shaderManager.addShader(new GRAUZONE());
break; break;
case(16):
shaderManager.addShader(new COPYZOOM());
break;
/* /*
case(4): case(4):
shaderManager.addShader(new AUECHO()); shaderManager.addShader(new AUECHO());

+ 1
- 1
statics_and_lists.pde View File

"fxPosterize", "fxPosterize",
"fxDual", "fxDual",
"fxGrauzone", "fxGrauzone",
"fxCopyZoom",
"fxMove", "fxMove",
"fxCopyZoom",
"fxScanker", "fxScanker",
"fxPixelSort", "fxPixelSort",

Loading…
Cancel
Save