From 8e963a5a6016d246184ed65906f9d103e92b17e2 Mon Sep 17 00:00:00 2001 From: Sascha Haeberling Date: Tue, 6 Aug 2013 11:43:02 -0700 Subject: This removes all non-Camera stuff from Camera2. Note: Camera2 is a clone of Gallery2 right now. Note 2: I will bring .mk files back later. Change-Id: Ida958654296f5ebaacb6bb0ff59d52a7c37ce6fc --- .../filtershow/filters/ImageFilterChanSat.java | 161 --------------------- 1 file changed, 161 deletions(-) delete mode 100644 src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java (limited to 'src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java') diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java deleted file mode 100644 index 1ea8edfb8..000000000 --- a/src/com/android/gallery3d/filtershow/filters/ImageFilterChanSat.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2013 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 com.android.gallery3d.filtershow.filters; - -import android.graphics.Bitmap; -import android.graphics.Matrix; -import android.support.v8.renderscript.Allocation; -import android.support.v8.renderscript.Element; -import android.support.v8.renderscript.RenderScript; -import android.support.v8.renderscript.Script.LaunchOptions; -import android.support.v8.renderscript.Type; - -import com.android.gallery3d.R; -import com.android.gallery3d.filtershow.pipeline.FilterEnvironment; - -public class ImageFilterChanSat extends ImageFilterRS { - private static final String LOGTAG = "ImageFilterChanSat"; - private ScriptC_saturation mScript; - private Bitmap mSourceBitmap; - - private static final int STRIP_SIZE = 64; - - FilterChanSatRepresentation mParameters = new FilterChanSatRepresentation(); - private Bitmap mOverlayBitmap; - - public ImageFilterChanSat() { - mName = "ChannelSat"; - } - - @Override - public FilterRepresentation getDefaultRepresentation() { - return new FilterChanSatRepresentation(); - } - - @Override - public void useRepresentation(FilterRepresentation representation) { - mParameters = (FilterChanSatRepresentation) representation; - } - - @Override - protected void resetAllocations() { - - } - - @Override - public void resetScripts() { - if (mScript != null) { - mScript.destroy(); - mScript = null; - } - } - @Override - protected void createFilter(android.content.res.Resources res, float scaleFactor, - int quality) { - createFilter(res, scaleFactor, quality, getInPixelsAllocation()); - } - - @Override - protected void createFilter(android.content.res.Resources res, float scaleFactor, - int quality, Allocation in) { - RenderScript rsCtx = getRenderScriptContext(); - - Type.Builder tb_float = new Type.Builder(rsCtx, Element.F32_4(rsCtx)); - tb_float.setX(in.getType().getX()); - tb_float.setY(in.getType().getY()); - mScript = new ScriptC_saturation(rsCtx, res, R.raw.saturation); - } - - - private Bitmap getSourceBitmap() { - assert (mSourceBitmap != null); - return mSourceBitmap; - } - - @Override - public Bitmap apply(Bitmap bitmap, float scaleFactor, int quality) { - if (SIMPLE_ICONS && FilterEnvironment.QUALITY_ICON == quality) { - return bitmap; - } - - mSourceBitmap = bitmap; - Bitmap ret = super.apply(bitmap, scaleFactor, quality); - mSourceBitmap = null; - - return ret; - } - - @Override - protected void bindScriptValues() { - int width = getInPixelsAllocation().getType().getX(); - int height = getInPixelsAllocation().getType().getY(); - } - - - - @Override - protected void runFilter() { - int []sat = new int[7]; - for(int i = 0;i height) { - endy = height; - } - options.setY(ty, endy); - mScript.forEach_selectiveAdjust(in, out, options); - if (checkStop()) { - return; - } - } - } - - private boolean checkStop() { - RenderScript rsCtx = getRenderScriptContext(); - rsCtx.finish(); - if (getEnvironment().needsStop()) { - return true; - } - return false; - } -} - -- cgit v1.2.3