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