• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 package android.graphics;
18 
19 import android.compat.annotation.UnsupportedAppUsage;
20 
21 /**
22  * @hide
23  */
24 @android.ravenwood.annotation.RavenwoodKeepWholeClass
25 public class TableMaskFilter extends MaskFilter {
26 
TableMaskFilter(byte[] table)27     public TableMaskFilter(byte[] table) {
28         if (table.length < 256) {
29             throw new RuntimeException("table.length must be >= 256");
30         }
31         native_instance = nativeNewTable(table);
32     }
33 
TableMaskFilter(long ni)34     private TableMaskFilter(long ni) {
35         native_instance = ni;
36     }
37 
38     @UnsupportedAppUsage
CreateClipTable(int min, int max)39     public static TableMaskFilter CreateClipTable(int min, int max) {
40         return new TableMaskFilter(nativeNewClip(min, max));
41     }
42 
CreateGammaTable(float gamma)43     public static TableMaskFilter CreateGammaTable(float gamma) {
44         return new TableMaskFilter(nativeNewGamma(gamma));
45     }
46 
nativeNewTable(byte[] table)47     private static native long nativeNewTable(byte[] table);
nativeNewClip(int min, int max)48     private static native long nativeNewClip(int min, int max);
nativeNewGamma(float gamma)49     private static native long nativeNewGamma(float gamma);
50 }
51