From: Hsuan-Hao Date: Thu, 29 Jun 2017 10:36:20 +0000 (+0200) Subject: modify Test code X-Git-Url: http://git.risc.jku.at/gitweb/?a=commitdiff_plain;h=9774095b4b808b856f37bb20b00436a25e342f30;p=ipau%2FColorBlackWhiteConversion.git modify Test code --- diff --git a/finalproject_Hao/TestColor.java b/finalproject_Hao/TestColor.java index 23c085f..7276646 100644 --- a/finalproject_Hao/TestColor.java +++ b/finalproject_Hao/TestColor.java @@ -19,6 +19,7 @@ public class TestColor { BufferedImage input_image; BufferedImage output_image; + BufferedImage output_image_gray; BufferedImage image; int width; int height; @@ -27,9 +28,7 @@ public class TestColor { public void setUp() throws Exception { LoadFile file = new LoadFile(); input_image = file.Load_File("test.jpg"); - - BlackandWhite bw_image = new BlackandWhite(); - output_image = bw_image.Black_and_White(input_image); + } /** @@ -41,7 +40,9 @@ public class TestColor { @Test public void testBlackandWhite() { - + BlackandWhite bw_image = new BlackandWhite(); + output_image = bw_image.Black_and_White(input_image); + try { width = output_image.getWidth(); @@ -65,5 +66,30 @@ public class TestColor { } catch (Exception e) {} } - + @Test + public void testGray() { + GrayScale g_image = new GrayScale(); + output_image_gray = g_image.Gray_Scale(input_image); + try { + + width = output_image_gray.getWidth(); + height = output_image_gray.getHeight(); + + for(int i=0; i