Home | History | Annotate | Download | only in filters
      1 /*
      2  * Copyright (C) 2014 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 #ifndef INTRINSIC_BLUR_FILTER_H_
     18 #define INTRINSIC_BLUR_FILTER_H_
     19 
     20 #include "RenderScript.h"
     21 #include "SimpleFilter.h"
     22 
     23 namespace android {
     24 
     25 struct IntrinsicBlurFilter : public SimpleFilter {
     26 public:
     27     IntrinsicBlurFilter() : mBlurRadius(1.f) {};
     28 
     29     virtual status_t configure(const sp<AMessage> &msg);
     30     virtual status_t start();
     31     virtual void reset();
     32     virtual status_t setParameters(const sp<AMessage> &msg);
     33     virtual status_t processBuffers(
     34             const sp<ABuffer> &srcBuffer, const sp<ABuffer> &outBuffer);
     35 
     36 protected:
     37     virtual ~IntrinsicBlurFilter() {};
     38 
     39 private:
     40     AString mCacheDir;
     41     RSC::sp<RSC::RS> mRS;
     42     RSC::sp<RSC::Allocation> mAllocIn;
     43     RSC::sp<RSC::Allocation> mAllocOut;
     44     RSC::sp<RSC::ScriptIntrinsicBlur> mBlur;
     45     float mBlurRadius;
     46 };
     47 
     48 }   // namespace android
     49 
     50 #endif  // INTRINSIC_BLUR_FILTER_H_
     51