1 /*
2  * Copyright (c) 2024 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 #ifndef RENDER_SERVICE_CLIENT_CORE_RENDER_RS_MAGNIFIER_PARA_H
16 #define RENDER_SERVICE_CLIENT_CORE_RENDER_RS_MAGNIFIER_PARA_H
17 
18 #include "common/rs_color.h"
19 #include "common/rs_macros.h"
20 #include <cstdint>
21 #include <iomanip>
22 #include <sstream>
23 
24 namespace OHOS {
25 namespace Rosen {
26 
27 class RSB_EXPORT RSMagnifierParams {
28 public:
RSMagnifierParams()29     explicit RSMagnifierParams() {}
30     ~RSMagnifierParams() = default;
31 
32     float factor_ = 0.f;
33     float width_ = 0.f;
34     float height_ = 0.f;
35     float cornerRadius_ = 0.f;
36     float borderWidth_ = 0.f;
37     float offsetX_ = 0.f;
38     float offsetY_ = 0.f;
39 
40     float shadowOffsetX_ = 0.f;
41     float shadowOffsetY_ = 0.f;
42     float shadowSize_ = 0.f;
43     float shadowStrength_ = 0.f;
44 
45     // rgba
46     uint32_t gradientMaskColor1_ = 0x00000000;
47     uint32_t gradientMaskColor2_ = 0x00000000;
48     uint32_t outerContourColor1_ = 0x00000000;
49     uint32_t outerContourColor2_ = 0x00000000;
50 
Dump(std::string & out)51     void Dump(std::string& out) const
52     {
53         out += "[factor:" + std::to_string(factor_) + " width:" + std::to_string(width_);
54         out += " height:" + std::to_string(height_) + " cornerRadius:" + std::to_string(cornerRadius_);
55         out += " borderWidth:" + std::to_string(borderWidth_) + " offsetX:" + std::to_string(offsetX_);
56         out += " offsetY:" + std::to_string(offsetY_) + " shadowOffsetX:" + std::to_string(shadowOffsetX_);
57         out += " shadowOffsetY:" + std::to_string(shadowOffsetY_) + " shadowSize:" + std::to_string(shadowSize_);
58         out += " shadowStrength:" + std::to_string(shadowStrength_);
59         RSColor color(gradientMaskColor1_);
60         out += " gradientMaskColor1";
61         color.Dump(out);
62         color = RSColor(gradientMaskColor2_);
63         out += " gradientMaskColor2";
64         color.Dump(out);
65         color = RSColor(outerContourColor1_);
66         out += " outerContourColor1";
67         color.Dump(out);
68         color = RSColor(outerContourColor2_);
69         out += " outerContourColor2";
70         color.Dump(out);
71         out += ']';
72     }
73 };
74 
75 } // namespace Rosen
76 } // namespace OHOS
77 
78 #endif // RENDER_SERVICE_CLIENT_CORE_RENDER_RS_MAGNIFIER_PARA_H
79