1 /*
2  * Copyright (c) 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_SHOWING_PROPERTIES_FREEZER_H
17 #define RENDER_SERVICE_CLIENT_CORE_MODIFIER_RS_SHOWING_PROPERTIES_FREEZER_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 RSShowingPropertiesFreezer {
27 public:
28     RSShowingPropertiesFreezer(NodeId id);
29     virtual ~RSShowingPropertiesFreezer() = default;
30 
31     std::optional<Vector4f> GetBounds() const;
32     std::optional<Vector4f> GetFrame() const;
33     std::optional<float> GetPositionZ() const;
34 
35     std::optional<Vector2f> GetPivot() const;
36     std::optional<float> GetPivotZ() const;
37     std::optional<Quaternion> GetQuaternion() const;
38     std::optional<float> GetRotation() const;
39     std::optional<float> GetRotationX() const;
40     std::optional<float> GetRotationY() const;
41     std::optional<float> GetCameraDistance() const;
42     std::optional<Vector2f> GetTranslate() const;
43     std::optional<float> GetTranslateZ() const;
44     std::optional<Vector2f> GetScale() const;
45     std::optional<Vector2f> GetSkew() const;
46     std::optional<Vector2f> GetPersp() const;
47 
48     std::optional<float> GetAlpha() const;
49     std::optional<Vector4f> GetCornerRadius() const;
50 
51     std::optional<Color> GetForegroundColor() const;
52     std::optional<Color> GetBackgroundColor() const;
53     std::optional<Color> GetSurfaceBgColor() const;
54     std::optional<float> GetBgImageWidth() const;
55     std::optional<float> GetBgImageHeight() const;
56     std::optional<float> GetBgImagePositionX() const;
57     std::optional<float> GetBgImagePositionY() const;
58 
59     std::optional<Vector4<Color>> GetBorderColor() const;
60     std::optional<Vector4f> GetBorderWidth() const;
61 
62     std::optional<std::shared_ptr<RSFilter>> GetBackgroundFilter() const;
63     std::optional<std::shared_ptr<RSFilter>> GetFilter() const;
64 
65     std::optional<Color> GetShadowColor() const;
66     std::optional<float> GetShadowOffsetX() const;
67     std::optional<float> GetShadowOffsetY() const;
68     std::optional<float> GetShadowAlpha() const;
69     std::optional<float> GetShadowElevation() const;
70     std::optional<float> GetShadowRadius() const;
71 
72     std::optional<float> GetSpherizeDegree() const;
73     std::optional<float> GetLightUpEffectDegree() const;
74     std::optional<float> GetDynamicDimDegree() const;
75 
76     std::optional<float> GetAttractionFractionValue() const;
77     std::optional<Vector2f> GetAttractionDstPointValue() const;
78 
79 private:
80     NodeId id_;
81     template<typename T, RSModifierType Type>
82     std::optional<T> GetPropertyImpl() const;
83 };
84 } // namespace Rosen
85 } // namespace OHOS
86 
87 #endif // RENDER_SERVICE_CLIENT_CORE_MODIFIER_RS_SHOWING_PROPERTIES_FREEZER_H
88