diff options
author | Mike Reed <reed@google.com> | 2009-10-30 14:13:44 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2009-10-30 14:13:44 -0700 |
commit | 58d30b69071363aba38307bc5ee3b2d81f22f09d (patch) | |
tree | 38aef09e61d2065a75fd4549cfcd7b375504805c /graphics/java | |
parent | a823534008afa45f61faca4088c5aabe9b956117 (diff) | |
parent | 1864d01f2be0e82da7d8844fa91bee8880282041 (diff) | |
download | frameworks_base-58d30b69071363aba38307bc5ee3b2d81f22f09d.zip frameworks_base-58d30b69071363aba38307bc5ee3b2d81f22f09d.tar.gz frameworks_base-58d30b69071363aba38307bc5ee3b2d81f22f09d.tar.bz2 |
am 1864d01f: Merge change Iae849da2 into eclair
Merge commit '1864d01f2be0e82da7d8844fa91bee8880282041' into eclair-mr2
* commit '1864d01f2be0e82da7d8844fa91bee8880282041':
add table maskfilter
Diffstat (limited to 'graphics/java')
-rw-r--r-- | graphics/java/android/graphics/TableMaskFilter.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/TableMaskFilter.java b/graphics/java/android/graphics/TableMaskFilter.java new file mode 100644 index 0000000..a8a7ff0 --- /dev/null +++ b/graphics/java/android/graphics/TableMaskFilter.java @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2006 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.graphics; + +/** + * @hide + */ +public class TableMaskFilter extends MaskFilter { + + public TableMaskFilter(byte[] table) { + if (table.length < 256) { + throw new RuntimeException("table.length must be >= 256"); + } + native_instance = nativeNewTable(table); + } + + private TableMaskFilter(int ni) { + native_instance = ni; + } + + public static TableMaskFilter CreateClipTable(int min, int max) { + return new TableMaskFilter(nativeNewClip(min, max)); + } + + public static TableMaskFilter CreateGammaTable(float gamma) { + return new TableMaskFilter(nativeNewGamma(gamma)); + } + + private static native int nativeNewTable(byte[] table); + private static native int nativeNewClip(int min, int max); + private static native int nativeNewGamma(float gamma); +} |