From 97b6aa89d4d88899634cef7364dac63eda131fa9 Mon Sep 17 00:00:00 2001 From: benfry Date: Thu, 29 Jun 2006 15:02:11 +0000 Subject: [PATCH] cleaning up from some changes --- core/PApplet.java | 6 ------ core/PGraphicsJava.java | 12 ++++++------ core/PImage.java | 10 ++++++---- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/core/PApplet.java b/core/PApplet.java index 92473cb57..09b6ef0a3 100644 --- a/core/PApplet.java +++ b/core/PApplet.java @@ -6390,12 +6390,6 @@ public class PApplet extends Applet } - public void updatePixels() { - if (recorder != null) recorder.updatePixels(); - g.updatePixels(); - } - - public void endPixels() { if (recorder != null) recorder.endPixels(); g.endPixels(); diff --git a/core/PGraphicsJava.java b/core/PGraphicsJava.java index 5f95dae93..ae6a010fe 100644 --- a/core/PGraphicsJava.java +++ b/core/PGraphicsJava.java @@ -32,7 +32,7 @@ import java.awt.image.*; * Subclass for PGraphics that implements the graphics API * in Java 1.3+ using Java 2D. */ -public class PGraphics2 extends PGraphics { +public class PGraphicsJava extends PGraphics { public Graphics2D g2; GeneralPath gpath; @@ -59,11 +59,11 @@ public class PGraphics2 extends PGraphics { /** - * Constructor for the PGraphics2 object. + * Constructor for the PGraphicsJava object. * This prototype only exists because of annoying * java compilers, and should not be used. */ - public PGraphics2() { } + public PGraphicsJava() { } /** @@ -75,7 +75,7 @@ public class PGraphics2 extends PGraphics { * @param iwidth viewport width * @param iheight viewport height */ - public PGraphics2(int iwidth, int iheight, PApplet parent) { + public PGraphicsJava(int iwidth, int iheight, PApplet parent) { super(iwidth, iheight, parent); //resize(iwidth, iheight); } @@ -987,7 +987,7 @@ public class PGraphics2 extends PGraphics { * Update the pixels[] buffer to the PGraphics image. *

* Unlike in PImage, where endPixels() only asks that the - * update happens, in PGraphics2, this will happen immediately. + * update happens, in PGraphicsJava, this will happen immediately. */ public void endPixels() { //endPixels(0, 0, width, height); @@ -1000,7 +1000,7 @@ public class PGraphics2 extends PGraphics { * Update the pixels[] buffer to the PGraphics image. *

* Unlike in PImage, where endPixels() only asks that the - * update happens, in PGraphics2, this will happen immediately. + * update happens, in PGraphicsJava, this will happen immediately. */ public void endPixels(int x, int y, int c, int d) { if ((x == 0) && (y == 0) && (c == width) && (d == height)) { diff --git a/core/PImage.java b/core/PImage.java index b185604ee..bba37d65d 100644 --- a/core/PImage.java +++ b/core/PImage.java @@ -586,8 +586,9 @@ public class PImage implements PConstants, Cloneable { * Mario Klingemann */ public void filter(int kind) { - switch (kind) { + beginPixels(); + switch (kind) { case BLUR: // TODO write basic low-pass filter blur here // what does photoshop do on the edges with this guy? @@ -641,7 +642,7 @@ public class PImage implements PConstants, Cloneable { dilate(false); break; } - updatePixels(); // mark as modified + endPixels(); // mark as modified } @@ -662,8 +663,9 @@ public class PImage implements PConstants, Cloneable { * and later updated by toxi for better speed. */ public void filter(int kind, float param) { - switch (kind) { + beginPixels(); + switch (kind) { case BLUR: if (format == ALPHA) blurAlpha(param); @@ -729,7 +731,7 @@ public class PImage implements PConstants, Cloneable { throw new RuntimeException("Use filter(DILATE) instead of " + "filter(DILATE, param)"); } - updatePixels(); // mark as modified + endPixels(); // mark as modified }