@Test public void testCreateIndexedIntArray1to8() { for (int bits = 1; bits <= 8; bits <<= 1) { int[] colors = createIntLut(1 << bits); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(new IndexColorModel(bits, colors.length, colors, 0, false, -1, DataBuffer.TYPE_BYTE)), ImageTypeSpecifiers.createIndexed(colors, false, -1, bits, DataBuffer.TYPE_BYTE) ); } }
@Test public void testCreateFromIndexedColorModel16() { int[] colors = createIntLut(1 << 16); IndexColorModel colorModel = new IndexColorModel(16, colors.length, colors, 0, false, -1, DataBuffer.TYPE_USHORT); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(colorModel), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); }
@Test public void testCreateFromIndexedColorModel1to8() { for (int bits = 1; bits <= 8; bits <<= 1) { int[] colors = createIntLut(1 << bits); IndexColorModel colorModel = new IndexColorModel(bits, colors.length, colors, 0, false, -1, DataBuffer.TYPE_BYTE); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(colorModel), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); } }
@Test public void testCreateIndexedIntArray16() { int[] colors = createIntLut(1 << 16); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(new IndexColorModel(16, colors.length, colors, 0, false, -1, DataBuffer.TYPE_USHORT)), ImageTypeSpecifiers.createIndexed(colors, false, -1, 16, DataBuffer.TYPE_USHORT) ); }
@Test public void testCreateDiscreteAlphaIndexedFromIndexColorModel8() { int[] colors = createIntLut(1 << 8); IndexColorModel colorModel = new IndexColorModel(8, colors.length, colors, 0, false, -1, DataBuffer.TYPE_BYTE); assertEquals( new ImageTypeSpecifier(colorModel, colorModel.createCompatibleSampleModel(1, 1)), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); }
@Test public void testCreateDiscreteAlphaIndexedFromIndexColorModel16() { int[] colors = createIntLut(1 << 16); IndexColorModel colorModel = new IndexColorModel(16, colors.length, colors, 0, false, -1, DataBuffer.TYPE_USHORT); assertEquals( new ImageTypeSpecifier(colorModel, colorModel.createCompatibleSampleModel(1, 1)), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); }
@Test public void testCreateIndexedIntArray16() { int[] colors = createIntLut(1 << 16); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(new IndexColorModel(16, colors.length, colors, 0, false, -1, DataBuffer.TYPE_USHORT)), ImageTypeSpecifiers.createIndexed(colors, false, -1, 16, DataBuffer.TYPE_USHORT) ); }
@Test public void testCreateIndexedIntArray1to8() { for (int bits = 1; bits <= 8; bits <<= 1) { int[] colors = createIntLut(1 << bits); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(new IndexColorModel(bits, colors.length, colors, 0, false, -1, DataBuffer.TYPE_BYTE)), ImageTypeSpecifiers.createIndexed(colors, false, -1, bits, DataBuffer.TYPE_BYTE) ); } }
@Test public void testCreateFromIndexedColorModel16() { int[] colors = createIntLut(1 << 16); IndexColorModel colorModel = new IndexColorModel(16, colors.length, colors, 0, false, -1, DataBuffer.TYPE_USHORT); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(colorModel), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); }
@Test public void testCreateFromIndexedColorModel1to8() { for (int bits = 1; bits <= 8; bits <<= 1) { int[] colors = createIntLut(1 << bits); IndexColorModel colorModel = new IndexColorModel(bits, colors.length, colors, 0, false, -1, DataBuffer.TYPE_BYTE); assertEquals( IndexedImageTypeSpecifier.createFromIndexColorModel(colorModel), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); } }
@Test public void testCreateDiscreteAlphaIndexedFromIndexColorModel16() { int[] colors = createIntLut(1 << 16); IndexColorModel colorModel = new IndexColorModel(16, colors.length, colors, 0, false, -1, DataBuffer.TYPE_USHORT); assertEquals( new ImageTypeSpecifier(colorModel, colorModel.createCompatibleSampleModel(1, 1)), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); }
@Test public void testCreateDiscreteAlphaIndexedFromIndexColorModel8() { int[] colors = createIntLut(1 << 8); IndexColorModel colorModel = new IndexColorModel(8, colors.length, colors, 0, false, -1, DataBuffer.TYPE_BYTE); assertEquals( new ImageTypeSpecifier(colorModel, colorModel.createCompatibleSampleModel(1, 1)), ImageTypeSpecifiers.createFromIndexColorModel(colorModel) ); }