/** * Obtains a sub-image of the specified image, whose upper-left corner is * given by (x, y). */ public BufferedImage openImage(int no, int x, int y, int w, int h) throws FormatException, IOException { Class dataType = getNativeDataType(); if (BufferedImage.class.isAssignableFrom(dataType)) { // native data type is compatible with BufferedImage return (BufferedImage) openPlane(no, x, y, w, h); } else { // must construct BufferedImage from byte array return AWTImageTools.openImage(openBytes(no, x, y, w, h), this, w, h); } }
/** * Obtains a sub-image of the specified image, whose upper-left corner is * given by (x, y). */ public BufferedImage openImage(int no, int x, int y, int w, int h) throws FormatException, IOException { Class dataType = getNativeDataType(); if (BufferedImage.class.isAssignableFrom(dataType)) { // native data type is compatible with BufferedImage return (BufferedImage) openPlane(no, x, y, w, h); } else { // must construct BufferedImage from byte array return AWTImageTools.openImage(openBytes(no, x, y, w, h), this, w, h); } }
for (int j=0; j<imageCount; j++) { try { reader.openBytes(j, buf);
md5 = TestTools.md5(reader.openBytes(0, 0, 0, w, h));
String md5 = TestTools.md5(reader.openBytes(0)); String expected1 = config.getMD5(); String expected2 = config.getAlternateMD5();
if (num > 3) num = 3; // test first three planes only, for speed for (int j=0; j<num && success; j++) { b = reader.openBytes(j); success = b.length == expected; if (!success) {