/*************************************************************************** * * **************************************************************************/ private void assertIntContents (final EditableImage image, final int... filler) { final Raster raster = getRaster(image); for (int b = 0; b < image.getBandCount(); b++) { for (int y = 0; y < image.getHeight(); y++) { for (int x = 0; x < image.getWidth(); x++) { int sample = raster.getSample(x, y, b); AssertJUnit.assertEquals(filler[b], sample); } } } }
/*************************************************************************** * * **************************************************************************/ private void assertDoubleContents (final EditableImage image, final double... filler) { final Raster raster = getRaster(image); for (int b = 0; b < image.getBandCount(); b++) { for (int y = 0; y < image.getHeight(); y++) { for (int x = 0; x < image.getWidth(); x++) { double sample = raster.getSampleDouble(x, y, b); AssertJUnit.assertEquals(filler[b], sample); } } } }
/*************************************************************************** * * **************************************************************************/ private void assertFloatContents (final EditableImage image, final float... filler) { final Raster raster = getRaster(image); for (int b = 0; b < image.getBandCount(); b++) { for (int y = 0; y < image.getHeight(); y++) { for (int x = 0; x < image.getWidth(); x++) { float sample = raster.getSampleFloat(x, y, b); AssertJUnit.assertEquals(filler[b], sample); } } } }
/*************************************************************************** * * **************************************************************************/ private void assertImage (final EditableImage image, final int bandCount, final int bitsPerBand, final int bitsPerPixel, final EditableImage.DataType dataType) { AssertJUnit.assertEquals(WIDTH, image.getWidth()); AssertJUnit.assertEquals(HEIGHT, image.getHeight()); AssertJUnit.assertEquals(bandCount, image.getBandCount()); AssertJUnit.assertEquals(bitsPerBand, image.getBitsPerBand()); AssertJUnit.assertEquals(bitsPerPixel, image.getBitsPerPixel()); AssertJUnit.assertEquals(dataType, image.getDataType()); } }
final int width = image.getWidth(); final int height = image.getHeight(); final int bandCount = image.getBandCount(); final int bitsPerBand = image.getBitsPerBand(); final int bitsPerPixel = image.getBitsPerPixel();
AssertJUnit.assertEquals(3, image.getBandCount()); AssertJUnit.assertEquals(8, image.getBitsPerBand()); AssertJUnit.assertEquals(24, image.getBitsPerPixel());