2727import java .awt .*;
2828import java .awt .image .*;
2929import java .io .*;
30- import java .lang .reflect .Method ;
3130import java .util .Iterator ;
3231
3332import 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