faster DefineBitsLosslessX reading

This commit is contained in:
honfika@gmail.com
2015-05-08 20:54:48 +02:00
parent 8a784d2d0b
commit 6d49dc584d
13 changed files with 7173 additions and 7030 deletions

View File

@@ -61,6 +61,15 @@ public class SerializableImage implements Serializable {
image = new BufferedImage(width, height, imageType);
}
public SerializableImage(int width, int height, int imageType, int[] pixels) {
if (imageType != BufferedImage.TYPE_INT_ARGB && imageType != BufferedImage.TYPE_INT_RGB) {
throw new Error("Unsuppported image type: " + imageType);
}
image = new BufferedImage(width, height, imageType);
image.getRaster().setDataElements(0, 0, width, height, pixels);
}
public SerializableImage(ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied, Hashtable<?, ?> properties) {
image = new BufferedImage(cm, raster, isRasterPremultiplied, properties);
}