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 SATURATION_FILTER_H_ 18#define SATURATION_FILTER_H_ 19 20#include <RenderScript.h> 21 22#include "ScriptC_saturationARGB.h" 23#include "SimpleFilter.h" 24 25namespace android { 26 27struct SaturationFilter : public SimpleFilter { 28public: 29 SaturationFilter() : mSaturation(1.f) {}; 30 31 virtual status_t configure(const sp<AMessage> &msg); 32 virtual status_t start(); 33 virtual void reset(); 34 virtual status_t setParameters(const sp<AMessage> &msg); 35 virtual status_t processBuffers( 36 const sp<MediaCodecBuffer> &srcBuffer, const sp<MediaCodecBuffer> &outBuffer); 37 38protected: 39 virtual ~SaturationFilter() {}; 40 41private: 42 AString mCacheDir; 43 RSC::sp<RSC::RS> mRS; 44 RSC::sp<RSC::Allocation> mAllocIn; 45 RSC::sp<RSC::Allocation> mAllocOut; 46 RSC::sp<ScriptC_saturationARGB> mScript; 47 float mSaturation; 48}; 49 50} // namespace android 51 52#endif // SATURATION_FILTER_H_ 53