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 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_SVG_BASE_SVG_FILTER_CONTEXT_H 16 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_SVG_BASE_SVG_FILTER_CONTEXT_H 17 #include "core/components_ng/svg/base/svg_length_scale_rule.h" 18 namespace OHOS::Ace::NG { 19 class SvgFilterContext { 20 public: SvgFilterContext(Rect effectFilterArea,SvgLengthScaleRule filterRule,SvgLengthScaleRule primitiveRule)21 SvgFilterContext(Rect effectFilterArea, SvgLengthScaleRule filterRule, SvgLengthScaleRule primitiveRule) 22 : filterArea_(effectFilterArea), filterRule_(filterRule), primitiveRule_(primitiveRule) {} 23 SvgFilterContext() = default; 24 ~SvgFilterContext() = default; 25 GetFilterArea()26 const Rect& GetFilterArea() const 27 { 28 return filterArea_; 29 } SetFilterArea(Rect & filterArea)30 void SetFilterArea(Rect& filterArea) 31 { 32 filterArea_ = filterArea; 33 } GetFilterRule()34 const SvgLengthScaleRule& GetFilterRule() const 35 { 36 return filterRule_; 37 } SetFilterRule(const SvgLengthScaleRule & filterRule)38 void SetFilterRule(const SvgLengthScaleRule& filterRule) 39 { 40 filterRule_ = filterRule; 41 } GetPrimitiveRule()42 const SvgLengthScaleRule& GetPrimitiveRule() const 43 { 44 return primitiveRule_; 45 } SetPrimitiveRule(const SvgLengthScaleRule & primitiveRule)46 void SetPrimitiveRule(const SvgLengthScaleRule& primitiveRule) 47 { 48 primitiveRule_ = primitiveRule; 49 } 50 private: 51 Rect filterArea_; 52 SvgLengthScaleRule filterRule_; 53 SvgLengthScaleRule primitiveRule_; 54 }; 55 } 56 #endif