• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
46     std::optional<float> GetAlpha() const;
47     std::optional<Vector4f> GetCornerRadius() const;
48 
49     std::optional<Color> GetForegroundColor() const;
50     std::optional<Color> GetBackgroundColor() const;
51     std::optional<Color> GetSurfaceBgColor() const;
52     std::optional<float> GetBgImageWidth() const;
53     std::optional<float> GetBgImageHeight() const;
54     std::optional<float> GetBgImagePositionX() const;
55     std::optional<float> GetBgImagePositionY() const;
56 
57     std::optional<Vector4<Color>> GetBorderColor() const;
58     std::optional<Vector4f> GetBorderWidth() const;
59 
60     std::optional<std::shared_ptr<RSFilter>> GetBackgroundFilter() const;
61     std::optional<std::shared_ptr<RSFilter>> GetFilter() const;
62 
63     std::optional<Color> GetShadowColor() const;
64     std::optional<float> GetShadowOffsetX() const;
65     std::optional<float> GetShadowOffsetY() const;
66     std::optional<float> GetShadowAlpha() const;
67     std::optional<float> GetShadowElevation() const;
68     std::optional<float> GetShadowRadius() const;
69 
70     std::optional<float> GetSpherizeDegree() const;
71     std::optional<float> GetLightUpEffectDegree() const;
72 
73 private:
74     NodeId id_;
75     template<typename T, RSModifierType Type>
76     std::optional<T> GetPropertyImpl() const;
77 };
78 } // namespace Rosen
79 } // namespace OHOS
80 
81 #endif // RENDER_SERVICE_CLIENT_CORE_MODIFIER_RS_SHOWING_PROPERTIES_FREEZER_H
82