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_EFFECT_H 17 #define IMAGE_EFFECT_EFFECT_H 18 19 #include "efilter.h" 20 21 namespace OHOS { 22 namespace Media { 23 namespace Effect { 24 class Effect { 25 public: 26 Effect() = default; 27 28 virtual ~Effect() = default; 29 30 virtual void AddEFilter(const std::shared_ptr<EFilter> &efilter); 31 32 virtual ErrorCode InsertEFilter(const std::shared_ptr<EFilter> &efilter, uint32_t index); 33 34 virtual void RemoveEFilter(const std::shared_ptr<EFilter> &efilter); 35 36 virtual ErrorCode RemoveEFilter(uint32_t index); 37 38 virtual ErrorCode ReplaceEFilter(const std::shared_ptr<EFilter> &efilter, uint32_t index); 39 40 virtual ErrorCode Start() = 0; 41 42 virtual ErrorCode Save(EffectJsonPtr &res) = 0; 43 GetEFilters()44 std::vector<std::shared_ptr<EFilter>> &GetEFilters() 45 { 46 return efilters_; 47 } 48 protected: 49 std::vector<std::shared_ptr<EFilter>> efilters_; 50 }; 51 } // namespace Effect 52 } // namespace Media 53 } // namespace OHOS 54 #endif // IMAGE_EFFECT_EFFECT_H 55