BlurMaskFilter.java revision 9066cfe9886ac131c34d59ed0e2d287b0e3c0087
1/*
2 * Copyright (C) 2006 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 android.graphics;
18
19public class BlurMaskFilter extends MaskFilter {
20
21    public enum Blur {
22        NORMAL(0),  //!< fuzzy inside and outside
23        SOLID(1),   //!< solid inside, fuzzy outside
24        OUTER(2),   //!< nothing inside, fuzzy outside
25        INNER(3);   //!< fuzzy inside, nothing outside
26
27        Blur(int value) {
28            native_int = value;
29        }
30        final int native_int;
31    }
32
33    /**
34     * Create a blur maskfilter.
35     *
36     * @param radius The radius to extend the blur from the original mask. Must be > 0.
37     * @param style  The Blur to use
38     * @return       The new blur maskfilter
39     */
40    public BlurMaskFilter(float radius, Blur style) {
41        native_instance = nativeConstructor(radius, style.native_int);
42    }
43
44    private static native int nativeConstructor(float radius, int style);
45}
46