From c3d751a2c2fe39bb0613ce139205bb59e1beb527 Mon Sep 17 00:00:00 2001 From: nicolasroard Date: Tue, 25 Sep 2012 14:27:56 -0700 Subject: Initial import of the new image editor bug:7165910 Change-Id: I756d6594f5bddd233772c979410362ca22e232a3 --- jni/filters/filters.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 jni/filters/filters.h (limited to 'jni/filters/filters.h') diff --git a/jni/filters/filters.h b/jni/filters/filters.h new file mode 100644 index 000000000..f8c4c5d08 --- /dev/null +++ b/jni/filters/filters.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2012 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. + */ + +#ifndef FILTERS_H +#define FILTERS_H + +#include +#include +#include +#include + +typedef unsigned int Color; + +#define SetColor(a, r, g, b) ((a << 24) | (b << 16) | (g << 8) | (r << 0)); +#define GetA(color) (((color) >> 24) & 0xFF) +#define GetB(color) (((color) >> 16) & 0xFF) +#define GetG(color) (((color) >> 8) & 0xFF) +#define GetR(color) (((color) >> 0) & 0xFF) + +#define MIN(a, b) (a < b ? a : b) +#define MAX(a, b) (a > b ? a : b) + +#define LOG(msg...) __android_log_print(ANDROID_LOG_VERBOSE, "NativeFilters", msg) + +#define JNIFUNCF(cls, name, vars...) Java_com_android_gallery3d_filtershow_filters_ ## cls ## _ ## name(JNIEnv* env, jobject this, vars) + +#define RED i +#define GREEN i+1 +#define BLUE i+2 +#define ALPHA i+3 +#define CLAMP(c) (MAX(0, MIN(255, c))) + +#endif // FILTERS_H -- cgit v1.2.3