/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4413109 4418221 6607198
* @run main BitDepth
* @summary Checks that the PNG and JPEG writers can handle various
* BufferedImage types. An optional list of arguments may be used to
* test a different format writer or writers.
*/
public class BitDepth {
}
// Check that the PNG writer can write an all-white image correctly
int width = 10;
int height = 10;
return false;
}
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
if (rgb != 0xffffffff) {
return false;
}
}
}
f.delete();
return true;
}
private static final int[] biRGBTypes = {
};
private static final int[] biRGBATypes = {
};
private static final int[] biGrayTypes = {
};
"CUSTOM",
"INT_RGB",
"INT_ARGB",
"INT_ARGB_PRE",
"INT_BGR",
"3BYTE_BGR",
"4BYTE_ABGR",
"4BYTE_ABGR_PRE",
"USHORT_565_RGB",
"USHORT_555_RGB",
"BYTE_GRAY",
"USHORT_GRAY",
"BYTE_BINARY",
"BYTE_INDEXED"
};
}
testFormat(format[i]);
}
}
boolean allOK = true;
int type = biRGBTypes[i];
boolean ok = testReadRGB(f);
if (ok) {
f.delete();
}
}
boolean ok = testPNGByteBinary();
}
if (!allOK) {
throw new RuntimeException("Test failed");
}
}
throws IOException {
try {
} catch (RuntimeException re) {
+ biTypeNames[type] +
" BufferedImage!");
}
return file;
}
}
int[] rgb = new int[3];
return false;
}
return false;
}
return false;
}
return false;
}
return false;
}
return true;
}
}