Skip to content

Commit a1b0131

Browse files
committed
Added loaded flag to PImage, removed cache object introspection in
loadPixels()
1 parent cf63a9e commit a1b0131

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

core/src/processing/core/PImage.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.awt.*;
2828
import java.awt.image.*;
2929
import java.io.*;
30-
import java.lang.reflect.Method;
3130
import java.util.Iterator;
3231

3332
import javax.imageio.*;
@@ -139,6 +138,8 @@ public class PImage implements PConstants, Cloneable {
139138
protected boolean modified;
140139
protected int mx1, my1, mx2, my2;
141140

141+
/** Loaded pixels flag */
142+
public boolean loaded = false;
142143

143144
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
144145

@@ -472,7 +473,9 @@ public void loadPixels() { // ignore
472473
if (pixels == null || pixels.length != width*height) {
473474
pixels = new int[width*height];
474475
}
476+
isLoaded();
475477

478+
/*
476479
if (parent != null) {
477480
Object cache = parent.g.initCache(this);
478481
if (cache != null) {
@@ -490,6 +493,7 @@ public void loadPixels() { // ignore
490493
}
491494
}
492495
}
496+
*/
493497
}
494498

495499

@@ -710,6 +714,25 @@ static private BufferedImage shrinkImage(BufferedImage img,
710714
}
711715

712716

717+
//////////////////////////////////////////////////////////////
718+
719+
// MARKING IMAGE AS LOADED / FOR USE IN RENDERERS
720+
721+
722+
public boolean isLoaded() { // ignore
723+
return loaded;
724+
}
725+
726+
727+
public void setLoaded() { // ignore
728+
loaded = true;
729+
}
730+
731+
732+
public void setLoaded(boolean l) { // ignore
733+
loaded = l;
734+
}
735+
713736

714737
//////////////////////////////////////////////////////////////
715738

0 commit comments

Comments
 (0)