IPTestListJB.java revision 250f8e278108651f802d44f555fd41e44d1ce633
1/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package com.android.rs.imagejb;
18
19import android.app.Activity;
20import android.view.View;
21import android.util.Log;
22
23public class IPTestListJB {
24    private final String TAG = "Img";
25    public final String RESULT_FILE = "image_processing_result.csv";
26
27    /**
28     * Define enum type for test names
29     */
30    public enum TestName {
31        // totally there are 38 test cases
32        LEVELS_VEC3_RELAXED ("Levels Vec3 Relaxed"),
33        LEVELS_VEC4_RELAXED ("Levels Vec4 Relaxed"),
34        LEVELS_VEC3_FULL ("Levels Vec3 Full"),
35        LEVELS_VEC4_FULL ("Levels Vec4 Full"),
36        BLUR_RADIUS_25 ("Blur radius 25"),
37        INTRINSIC_BLUE_RADIUS_25 ("Intrinsic Blur radius 25"),
38        GREYSCALE ("Greyscale"),
39        GRAIN ("Grain"),
40        FISHEYE_FULL ("Fisheye Full"),
41        FISHEYE_RELAXED ("Fisheye Relaxed"),
42        FISHEYE_APPROXIMATE_FULL ("Fisheye Approximate Full"),
43        FISHEYE_APPROXIMATE_RELAXED ("Fisheye Approximate Relaxed"),
44        VIGNETTE_FULL ("Vignette Full"),
45        VIGNETTE_RELAXED ("Vignette Relaxed"),
46        VIGNETTE_APPROXIMATE_FULL ("Vignette Approximate Full"),
47        VIGNETTE_APPROXIMATE_RELAXED ("Vignette Approximate Relaxed"),
48        GROUP_TEST_EMULATED ("Group Test (emulated)"),
49        GROUP_TEST_NATIVE ("Group Test (native)"),
50        CONVOLVE_3X3 ("Convolve 3x3"),
51        INTRINSICS_CONVOLVE_3X3 ("Intrinsics Convolve 3x3"),
52        COLOR_MATRIX ("ColorMatrix"),
53        INTRINSICS_COLOR_MATRIX ("Intrinsics ColorMatrix"),
54        INTRINSICS_COLOR_MATRIX_GREY ("Intrinsics ColorMatrix Grey"),
55        COPY ("Copy"),
56        CROSS_PROCESS_USING_LUT ("CrossProcess (using LUT)"),
57        CONVOLVE_5X5 ("Convolve 5x5"),
58        INTRINSICS_CONVOLVE_5X5 ("Intrinsics Convolve 5x5"),
59        MANDELBROT ("Mandelbrot"),
60        INTRINSICS_BLEND ("Intrinsics Blend"),
61        VIBRANCE ("Vibrance"),
62        BW_FILTER ("BW Filter"),
63        SHADOWS ("Shadows"),
64        CONTRAST ("Contrast"),
65        EXPOSURE ("Exposure"),
66        WHITE_BALANCE ("White Balance");
67
68
69        private final String name;
70
71        private TestName(String s) {
72            name = s;
73        }
74
75        // return quoted string as displayed test name
76        public String toString() {
77            return name;
78        }
79    }
80
81    static TestBase newTest(TestName testName) {
82        switch(testName) {
83        case LEVELS_VEC3_RELAXED:
84            return new LevelsV4(false, false);
85        case LEVELS_VEC4_RELAXED:
86            return new LevelsV4(false, true);
87        case LEVELS_VEC3_FULL:
88            return new LevelsV4(true, false);
89        case LEVELS_VEC4_FULL:
90            return new LevelsV4(true, true);
91        case BLUR_RADIUS_25:
92            return new Blur25(false);
93        case INTRINSIC_BLUE_RADIUS_25:
94            return new Blur25(true);
95        case GREYSCALE:
96            return new Greyscale();
97        case GRAIN:
98            return new Grain();
99        case FISHEYE_FULL:
100            return new Fisheye(false, false);
101        case FISHEYE_RELAXED:
102            return new Fisheye(false, true);
103        case FISHEYE_APPROXIMATE_FULL:
104            return new Fisheye(true, false);
105        case FISHEYE_APPROXIMATE_RELAXED:
106            return new Fisheye(true, true);
107        case VIGNETTE_FULL:
108            return new Vignette(false, false);
109        case VIGNETTE_RELAXED:
110            return new Vignette(false, true);
111        case VIGNETTE_APPROXIMATE_FULL:
112            return new Vignette(true, false);
113        case VIGNETTE_APPROXIMATE_RELAXED:
114            return new Vignette(true, true);
115        case GROUP_TEST_EMULATED:
116            return new GroupTest(false);
117        case GROUP_TEST_NATIVE:
118            return new GroupTest(true);
119        case CONVOLVE_3X3:
120            return new Convolve3x3(false);
121        case INTRINSICS_CONVOLVE_3X3:
122            return new Convolve3x3(true);
123        case COLOR_MATRIX:
124            return new ColorMatrix(false, false);
125        case INTRINSICS_COLOR_MATRIX:
126            return new ColorMatrix(true, false);
127        case INTRINSICS_COLOR_MATRIX_GREY:
128            return new ColorMatrix(true, true);
129        case COPY:
130            return new Copy();
131        case CROSS_PROCESS_USING_LUT:
132            return new CrossProcess();
133        case CONVOLVE_5X5:
134            return new Convolve5x5(false);
135        case INTRINSICS_CONVOLVE_5X5:
136            return new Convolve5x5(true);
137        case MANDELBROT:
138            return new Mandelbrot();
139        case INTRINSICS_BLEND:
140            return new Blend();
141        case VIBRANCE:
142            return new Vibrance();
143        case BW_FILTER:
144            return new BWFilter();
145        case SHADOWS:
146            return new Shadows();
147        case CONTRAST:
148            return new Contrast();
149        case EXPOSURE:
150            return new Exposure();
151        case WHITE_BALANCE:
152            return new WhiteBalance();
153        }
154        return null;
155    }
156
157}
158
159