diff options
Diffstat (limited to 'src/main/java/SignatureChecks.java')
-rw-r--r-- | src/main/java/SignatureChecks.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/main/java/SignatureChecks.java b/src/main/java/SignatureChecks.java new file mode 100644 index 0000000..f8a4355 --- /dev/null +++ b/src/main/java/SignatureChecks.java | |||
@@ -0,0 +1,37 @@ | |||
1 | public class SignatureChecks { | ||
2 | |||
3 | @SuppressWarnings("unused") | ||
4 | public static void main(String[] argv) { | ||
5 | |||
6 | // Check if the signatures of all required function in class Color are correct | ||
7 | float color; | ||
8 | int value; | ||
9 | float[][] gray = new float[4][4]; | ||
10 | int[][] image; | ||
11 | color = Color.getRed(0); | ||
12 | color = Color.getGreen(0); | ||
13 | color = Color.getBlue(0); | ||
14 | color = Color.getGray(0); | ||
15 | value = Color.getRGB(0.0f, 0.0f, 0.0f); | ||
16 | value = Color.getRGB(0.0f); | ||
17 | image = Color.toRGB(gray); | ||
18 | gray = Color.toGray(image); | ||
19 | |||
20 | // Check if the signatures of all required function in class Filter are correct | ||
21 | float[][] kernel = new float[3][3]; | ||
22 | color = Filter.at(gray, -1, -1); | ||
23 | gray = Filter.filter(gray, kernel); | ||
24 | gray = Filter.smooth(gray); | ||
25 | gray = Filter.sobel(gray); | ||
26 | |||
27 | // Check if the signatures of all required function in class Filter are correct | ||
28 | int[] path, seam; | ||
29 | float[] costs = new float[]{1, 1, 1}; | ||
30 | int[][] successors = new int[][]{{0, 1}, {}, {4}}; | ||
31 | float[][] energy = new float[4][4]; | ||
32 | path = Seam.path(successors, costs, 0, 2); | ||
33 | seam = Seam.find(energy); | ||
34 | image = Seam.merge(image, seam); | ||
35 | |||
36 | } | ||
37 | } | ||