1 /*
2  * Copyright (c) 2022-2023 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 RENDER_SERVICE_CLIENT_CORE_MODIFIER_RS_MODIFIER_EXTRACTOR_H
17 #define RENDER_SERVICE_CLIENT_CORE_MODIFIER_RS_MODIFIER_EXTRACTOR_H
18 
19 #include "common/rs_common_def.h"
20 #include "property/rs_properties.h"
21 #include "property/rs_properties_def.h"
22 
23 namespace OHOS {
24 namespace Rosen {
25 class RSNode;
26 
27 class RSC_EXPORT RSModifierExtractor {
28 public:
29     RSModifierExtractor(NodeId id);
30     virtual ~RSModifierExtractor() = default;
31 
32     Vector4f GetBounds() const;
33     Vector4f GetFrame() const;
34     float GetPositionZ() const;
35 
36     Vector2f GetPivot() const;
37     float GetPivotZ() const;
38     Quaternion GetQuaternion() const;
39     float GetRotation() const;
40     float GetRotationX() const;
41     float GetRotationY() const;
42     float GetCameraDistance() const;
43     Vector2f GetTranslate() const;
44     float GetTranslateZ() const;
45     Vector2f GetScale() const;
46     Vector2f GetSkew() const;
47     Vector2f GetPersp() const;
48 
49     float GetAlpha() const;
50     bool GetAlphaOffscreen() const;
51 
52     Vector4f GetCornerRadius() const;
53 
54     Color GetForegroundColor() const;
55     Color GetBackgroundColor() const;
56     Color GetSurfaceBgColor() const;
57     std::shared_ptr<RSShader> GetBackgroundShader() const;
58     std::shared_ptr<RSImage> GetBgImage() const;
59     float GetBgImageWidth() const;
60     float GetBgImageHeight() const;
61     float GetBgImagePositionX() const;
62     float GetBgImagePositionY() const;
63 
64     Vector4<Color> GetBorderColor() const;
65     Vector4f GetBorderWidth() const;
66     Vector4<uint32_t> GetBorderStyle() const;
67     Vector4f GetBorderDashWidth() const;
68     Vector4f GetBorderDashGap() const;
69     Vector4<Color> GetOutlineColor() const;
70     Vector4f GetOutlineWidth() const;
71     Vector4<uint32_t> GetOutlineStyle() const;
72     Vector4f GetOutlineDashWidth() const;
73     Vector4f GetOutlineDashGap() const;
74     Vector4f GetOutlineRadius() const;
75 
76     float GetForegroundEffectRadius() const;
77     std::shared_ptr<RSFilter> GetBackgroundFilter() const;
78     std::shared_ptr<RSFilter> GetFilter() const;
79 
80     Color GetShadowColor() const;
81     float GetShadowOffsetX() const;
82     float GetShadowOffsetY() const;
83     float GetShadowAlpha() const;
84     float GetShadowElevation() const;
85     float GetShadowRadius() const;
86     std::shared_ptr<RSPath> GetShadowPath() const;
87     bool GetShadowMask() const;
88     bool GetShadowIsFilled() const;
89     int GetShadowColorStrategy() const;
90 
91     Gravity GetFrameGravity() const;
92 
93     std::shared_ptr<RSPath> GetClipBounds() const;
94     bool GetClipToBounds() const;
95     bool GetClipToFrame() const;
96     bool GetVisible() const;
97 
98     std::shared_ptr<RSMask> GetMask() const;
99     float GetSpherizeDegree() const;
100     float GetLightUpEffectDegree() const;
101     float GetDynamicDimDegree() const;
102 
103     float GetAttractionFractionValue() const;
104     Vector2f GetAttractionDstPointValue() const;
105 
106     float GetBackgroundBlurRadius() const;
107     float GetBackgroundBlurSaturation() const;
108     float GetBackgroundBlurBrightness() const;
109     Color GetBackgroundBlurMaskColor() const;
110     int GetBackgroundBlurColorMode() const;
111     float GetBackgroundBlurRadiusX() const;
112     float GetBackgroundBlurRadiusY() const;
113 
114     float GetForegroundBlurRadius() const;
115     float GetForegroundBlurSaturation() const;
116     float GetForegroundBlurBrightness() const;
117     Color GetForegroundBlurMaskColor() const;
118     int GetForegroundBlurColorMode() const;
119     float GetForegroundBlurRadiusX() const;
120     float GetForegroundBlurRadiusY() const;
121 
122     float GetLightIntensity() const;
123     Color GetLightColor() const;
124     Vector4f GetLightPosition() const;
125     float GetIlluminatedBorderWidth() const;
126     int GetIlluminatedType() const;
127     float GetBloom() const;
128 
129     std::string Dump() const;
130 private:
131     NodeId id_;
132 };
133 } // namespace Rosen
134 } // namespace OHOS
135 
136 #endif // RENDER_SERVICE_CLIENT_CORE_MODIFIER_RS_MODIFIER_EXTRACTOR_H
137