• 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_ANIMATION_RS_MODIFIER_EXTRACTOR_H
17 #define RENDER_SERVICE_CLIENT_CORE_ANIMATION_RS_MODIFIER_EXTRACTOR_H
18 
19 #include "common/rs_common_def.h"
20 #include "property/rs_properties.h"
21 
22 namespace OHOS {
23 namespace Rosen {
24 class RSNode;
25 
26 class RSC_EXPORT RSModifierExtractor {
27 public:
28     RSModifierExtractor(NodeId id);
29     virtual ~RSModifierExtractor() = default;
30 
31     Vector4f GetBounds() const;
32     Vector4f GetFrame() const;
33     float GetPositionZ() const;
34 
35     Vector2f GetPivot() const;
36     Quaternion GetQuaternion() const;
37     float GetRotation() const;
38     float GetRotationX() const;
39     float GetRotationY() const;
40     Vector2f GetTranslate() const;
41     float GetTranslateZ() const;
42     Vector2f GetScale() const;
43 
44     float GetAlpha() const;
45     bool GetAlphaOffscreen() const;
46 
47     Vector4f GetCornerRadius() const;
48 
49     Color GetForegroundColor() const;
50     Color GetBackgroundColor() const;
51     Color GetSurfaceBgColor() const;
52     std::shared_ptr<RSShader> GetBackgroundShader() const;
53     std::shared_ptr<RSImage> GetBgImage() const;
54     float GetBgImageWidth() const;
55     float GetBgImageHeight() const;
56     float GetBgImagePositionX() const;
57     float GetBgImagePositionY() const;
58 
59     Vector4<Color> GetBorderColor() const;
60     Vector4f GetBorderWidth() const;
61     Vector4<uint32_t> GetBorderStyle() const;
62 
63     std::shared_ptr<RSFilter> GetBackgroundFilter() const;
64     std::shared_ptr<RSFilter> GetFilter() const;
65 
66     Color GetShadowColor() const;
67     float GetShadowOffsetX() const;
68     float GetShadowOffsetY() const;
69     float GetShadowAlpha() const;
70     float GetShadowElevation() const;
71     float GetShadowRadius() const;
72     std::shared_ptr<RSPath> GetShadowPath() const;
73 
74     Gravity GetFrameGravity() const;
75 
76     std::shared_ptr<RSPath> GetClipBounds() const;
77     bool GetClipToBounds() const;
78     bool GetClipToFrame() const;
79     bool GetVisible() const;
80 
81     std::shared_ptr<RSMask> GetMask() const;
82 
83     std::string Dump() const;
84 private:
85     NodeId id_;
86 };
87 } // namespace Rosen
88 } // namespace OHOS
89 
90 #endif // RENDER_SERVICE_CLIENT_CORE_ANIMATION_RS_MODIFIER_EXTRACTOR_H
91