summaryrefslogtreecommitdiffstats
path: root/jni/filters/contrast.c
diff options
context:
space:
mode:
authorJohn Hoford <hoford@google.com>2013-02-20 17:50:42 -0800
committerJohn Hoford <hoford@google.com>2013-02-21 11:24:47 -0800
commit8921c28c7333ad2b4d34f013904ad4737044f366 (patch)
tree6fd8a763bae0fd3c72ff78a1fc46a3b9e1451db6 /jni/filters/contrast.c
parent91b80b2560e663b15ee75ab1bca775028c7868c0 (diff)
downloadandroid_packages_apps_Gallery2-8921c28c7333ad2b4d34f013904ad4737044f366.tar.gz
android_packages_apps_Gallery2-8921c28c7333ad2b4d34f013904ad4737044f366.tar.bz2
android_packages_apps_Gallery2-8921c28c7333ad2b4d34f013904ad4737044f366.zip
add highlight filter
Change-Id: I2e59e09fbc80172b9dfe27b3ce8ff2f1e24c5872
Diffstat (limited to 'jni/filters/contrast.c')
-rw-r--r--jni/filters/contrast.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/jni/filters/contrast.c b/jni/filters/contrast.c
index 6c1b976cf..b04e9364e 100644
--- a/jni/filters/contrast.c
+++ b/jni/filters/contrast.c
@@ -27,6 +27,15 @@ unsigned char clamp(int c)
return (unsigned char) c;
}
+int clampMax(int c,int max)
+{
+ c &= ~(c >> 31);
+ c -= max;
+ c &= (c >> 31);
+ c += max;
+ return c;
+}
+
void JNIFUNCF(ImageFilterContrast, nativeApplyFilter, jobject bitmap, jint width, jint height, jfloat bright)
{
char* destination = 0;