cleaning up from some changes

This commit is contained in:
benfry
2006-06-29 15:02:11 +00:00
parent faa59a3254
commit 97b6aa89d4
3 changed files with 12 additions and 16 deletions
-6
View File
@@ -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();
+6 -6
View File
@@ -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.
* <P>
* 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.
* <P>
* 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)) {
+6 -4
View File
@@ -586,8 +586,9 @@ public class PImage implements PConstants, Cloneable {
* <A HREF="http://incubator.quasimondo.com">Mario Klingemann</A>
*/
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
}