Esempio n. 1
0
 @Override
 public void execute(Context context, float time) {
   PApplet applet = context.getApplet();
   pX.set((float) applet.mouseX);
   pY.set((float) applet.mouseY);
   pPreviousX.set((float) applet.pmouseX);
   pPreviousY.set((float) applet.pmouseY);
   pMousePressed.set(applet.mousePressed);
   pMouseButton.set(applet.mouseButton);
 }
Esempio n. 2
0
  @Override
  public int filter(int x, int y, int v) {
    int a = v & 0xff000000;
    int r = (v >> 16) & 0xff;
    int g = (v >> 8) & 0xff;
    int b = v & 0xff;
    r = clamp((int) (r * pRed.get()));
    g = clamp((int) (g * pGreen.get()));
    b = clamp((int) (b * pBlue.get()));

    return a | (r << 16) | (g << 8) | b;
  }