private void profileTest(TestHarness harness, ICC_Profile[] profiles)
{
harness.checkPoint("profile test, " + profiles[profiles.length-1].getClass().getName());
ColorConvertOp op = new ColorConvertOp(profiles, null);
Raster src = Raster.createBandedRaster(DataBuffer.TYPE_INT, 25, 40, 5, new Point(5, 5));
try
{
Raster dst = op.createCompatibleDestRaster(src);
harness.check(dst.getHeight(), src.getHeight());
harness.check(dst.getWidth(), src.getWidth());
// It appears we always use TYPE_BYTE regardless of the source raster
harness.check(dst.getTransferType(), DataBuffer.TYPE_BYTE);
harness.check(dst.getDataBuffer().getDataType(), DataBuffer.TYPE_BYTE);
// GRAY is the exception with 1 band; all others have 3
if (profiles[profiles.length-1].getColorSpaceType() == ColorSpace.TYPE_GRAY)
{
harness.check(dst.getNumBands(), 1);
harness.check(dst.getNumDataElements(), 1);
}
else
{
harness.check(dst.getNumBands(), 3);
harness.check(dst.getNumDataElements(), 3);
}
}
catch (IllegalArgumentException e)
{
harness.check(false);
}
// Try different numbers of bands in the source; the destination will
// ignore this and always have ColorSpace.getNumComponents() bands
// Essentially the dest raster will be identical to the case above,
// regardless of number of source bands (which makes sense)
for (int i = 1; i < 5; i++)
{
src = Raster.createBandedRaster(DataBuffer.TYPE_INT, 25, 40, i, new Point(5, 5));
try
{
Raster dst = op.createCompatibleDestRaster(src);
harness.check(dst.getTransferType(), DataBuffer.TYPE_BYTE);
harness.check(dst.getDataBuffer().getDataType(), DataBuffer.TYPE_BYTE);
if (profiles[profiles.length-1].getColorSpaceType() == ColorSpace.TYPE_GRAY)
{