fix transparency with new imageio (bug #350), add bug num to revisions.txt for lighting stuff

This commit is contained in:
benfry
2006-05-16 15:22:49 +00:00
parent 32a276a321
commit fa4e115d9f
5 changed files with 49 additions and 20 deletions

View File

@@ -144,6 +144,23 @@ public class PImage implements PConstants, Cloneable {
}
/**
* Check the alpha on an image, using a really primitive loop.
*/
protected void checkAlpha() {
if (pixels == null) return;
for (int i = 0; i < pixels.length; i++) {
// since transparency is often at corners, hopefully this
// will find a non-transparent pixel quickly and exit
if ((pixels[i] & 0xff000000) != 0xff000000) {
format = ARGB;
break;
}
}
}
/**
* Construct a new PImage from a java.awt.Image. This constructor assumes
* that you've done the work of making sure a MediaTracker has been used