} else {
throw new JXAException("src is not one of the supported class.");
}
Sprite sp = null;
boolean flushSp = false;
ImageTypeSpecifier type = SpriteIO._getITS(DEFAULT_TYPE);
if (!(src instanceof Sprite)) {
sp = new Sprite(bi, "image/x-png", imageSize = new Dimension(bi.getWidth(null), bi.getHeight(null)));
if (bi instanceof BufferedImage) {
type = SpriteIO._getITS((BufferedImage) bi);
}
flushSp = true;
} else {
sp = (Sprite) src;
type = sp.getFeatures();
imageSize = sp.getSize();
}
sp.setBufferedType(type.getNumComponents() == 3 ? BufferedImage.TYPE_3BYTE_BGR : DEFAULT_TYPE);
BufferedImage data = null;
if (sp != null) {
/**
* provide a shortcut to texture rectangle (no resizing) ^^
*/