1 /* 2 * Copyright (C) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef IMAGE_EFFECT_DELEGATE_H 17 #define IMAGE_EFFECT_DELEGATE_H 18 19 #include <memory> 20 21 #include "any.h" 22 #include "effect_buffer.h" 23 #include "effect_info.h" 24 #include "effect_context.h" 25 #include "image_effect_marco_define.h" 26 #include "json_helper.h" 27 28 namespace OHOS { 29 namespace Media { 30 namespace Effect { 31 class IFilterDelegate { 32 public: 33 virtual ~IFilterDelegate() = default; 34 35 IMAGE_EFFECT_EXPORT virtual bool Render(void *efilter, EffectBuffer *src, EffectBuffer *dst, 36 std::shared_ptr<EffectContext> &context) = 0; 37 38 IMAGE_EFFECT_EXPORT 39 virtual bool Render(void *efilter, EffectBuffer *src, std::shared_ptr<EffectContext> &context) = 0; 40 41 IMAGE_EFFECT_EXPORT virtual bool SetValue(void *efilter, const std::string &key, const Plugin::Any &value) = 0; 42 43 IMAGE_EFFECT_EXPORT virtual bool Save(void *efilter, EffectJsonPtr &res) = 0; 44 45 IMAGE_EFFECT_EXPORT virtual void *Restore(const EffectJsonPtr &values) = 0; 46 47 IMAGE_EFFECT_EXPORT virtual void *GetEffectInfo() = 0; 48 }; 49 } // namespace Effect 50 } // namespace Media 51 } // namespace OHOS 52 53 #endif // IMAGE_EFFECT_DELEGATE_H