Home | History | Annotate | Download | only in effects
      1 /*
      2  * Copyright (C) 2011 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 
     18 package android.media.effect.effects;
     19 
     20 import android.filterfw.core.Frame;
     21 import android.media.effect.EffectContext;
     22 import android.media.effect.FilterEffect;
     23 
     24 /**
     25  * @hide
     26  */
     27 public class IdentityEffect extends FilterEffect {
     28 
     29     public IdentityEffect(EffectContext context, String name) {
     30         super(context, name);
     31     }
     32 
     33     @Override
     34     public void apply(int inputTexId, int width, int height, int outputTexId) {
     35         beginGLEffect();
     36 
     37         Frame inputFrame = frameFromTexture(inputTexId, width, height);
     38         Frame outputFrame = frameFromTexture(outputTexId, width, height);
     39 
     40         outputFrame.setDataFromFrame(inputFrame);
     41 
     42         inputFrame.release();
     43         outputFrame.release();
     44 
     45         endGLEffect();
     46     }
     47 
     48     @Override
     49     public void setParameter(String parameterKey, Object value) {
     50         throw new IllegalArgumentException("Unknown parameter " + parameterKey
     51             + " for IdentityEffect!");
     52     }
     53 
     54     @Override
     55     public void release() {
     56     }
     57 }
     58 
     59