mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2026-03-20 00:00:03 -04:00
TMI-51: Implemented getCompatibleBufferedImageType as specified.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package com.twelvemonkeys.image;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import static com.twelvemonkeys.image.MappedImageFactory.createCompatibleMappedImage;
|
||||
import static com.twelvemonkeys.image.MappedImageFactory.getCompatibleBufferedImageType;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class MappedImageFactoryTest {
|
||||
|
||||
@Test
|
||||
public void testGetCompatibleBufferedImageTypeFromBufferedImage() throws Exception {
|
||||
for (int type = BufferedImage.TYPE_INT_RGB; type <= BufferedImage.TYPE_BYTE_INDEXED; type++) { // 1 - 13
|
||||
assertEquals(type, getCompatibleBufferedImageType(new BufferedImage(1, 1, type)));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetCompatibleBufferedImageType() throws Exception {
|
||||
for (int type = BufferedImage.TYPE_INT_RGB; type <= BufferedImage.TYPE_BYTE_INDEXED; type++) { // 1 - 13
|
||||
assertEquals(type, getCompatibleBufferedImageType(createCompatibleMappedImage(1, 1, type)));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user