@react-native-ohos/react-native-svg 15.12.1-rc.1 → 15.12.1-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.OpenSource +10 -10
- package/README.md +13 -13
- package/css/package.json +5 -5
- package/harmony/svg/BuildProfile.ets +16 -16
- package/harmony/svg/build-profile.json5 +9 -9
- package/harmony/svg/hvigorfile.ts +1 -1
- package/harmony/svg/index.ets +6 -6
- package/harmony/svg/oh-package.json5 +13 -13
- package/harmony/svg/src/main/cpp/SvgFilter.cpp +505 -505
- package/harmony/svg/src/main/cpp/SvgFilter.h +112 -112
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.cpp +40 -40
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeBlendComponentInstance.h +48 -48
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.cpp +33 -33
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeColorMatrixComponentInstance.h +48 -48
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.cpp +39 -39
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeCompositeComponentInstance.h +55 -55
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.cpp +33 -33
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeFloodComponentInstance.h +49 -49
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.cpp +34 -34
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeGaussianBlurComponentInstance.h +48 -48
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.cpp +35 -35
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFeOffsetComponentInstance.h +45 -45
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.cpp +198 -198
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGFilterComponentInstance.h +48 -48
- package/harmony/svg/src/main/cpp/componentInstances/RNSVGImageComponentInstance.cpp +4 -1
- package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.cpp +36 -15
- package/harmony/svg/src/main/cpp/downloadUtils/ImageSourceResolver.h +6 -10
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeBlendJSIBinder.h +26 -26
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeColorMatrixJSIBinder.h +26 -26
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeCompositeJSIBinder.h +30 -30
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeFloodJSIBinder.h +26 -26
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeGaussianBlurJSIBinder.h +26 -26
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFeOffsetJSIBinder.h +26 -26
- package/harmony/svg/src/main/cpp/generated/RNOH/generated/components/RNSVGFilterJSIBinder.h +44 -44
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.cpp +977 -977
- package/harmony/svg/src/main/cpp/generated/react/renderer/components/react_native_svg/Props.h +1280 -1280
- package/harmony/svg/src/main/cpp/utils/DynamicUtils.h +55 -55
- package/harmony/svg/src/main/cpp/utils/FilterManager.h +190 -190
- package/harmony/svg/src/main/ets/RNSVGImageModule.ts +21 -21
- package/harmony/svg/src/main/ets/RNSVGRenderableModule.ts +16 -16
- package/harmony/svg/src/main/ets/RNSVGSvgViewModule.ts +18 -18
- package/harmony/svg/src/main/ets/SvgPackage.ts +57 -57
- package/harmony/svg/src/main/module.json5 +7 -7
- package/harmony/svg/src/main/resources/base/element/string.json +8 -8
- package/harmony/svg/src/main/resources/en_US/element/string.json +8 -8
- package/harmony/svg/src/main/resources/zh_CN/element/string.json +8 -8
- package/harmony/svg/ts.ts +7 -7
- package/harmony/svg.har +0 -0
- package/lib/commonjs/css/index.js +54 -54
- package/lib/commonjs/index.js +25 -25
- package/lib/module/css/index.js +3 -3
- package/lib/module/index.js +2 -2
- package/package.json +52 -54
- package/src/css/index.tsx +19 -19
- package/src/index.tsx +2 -2
- package/tsconfig.json +11 -11
- package/lib/typescript/babel.config.d.ts +0 -8
- package/lib/typescript/babel.config.d.ts.map +0 -1
- package/lib/typescript/example/babel.config.d.ts +0 -3
- package/lib/typescript/example/babel.config.d.ts.map +0 -1
- package/lib/typescript/example/contexts.d.ts +0 -3
- package/lib/typescript/example/contexts.d.ts.map +0 -1
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts +0 -2
- package/lib/typescript/example/harmony/entry/hvigorfile.d.ts.map +0 -1
- package/lib/typescript/example/harmony/hvigorfile.d.ts +0 -2
- package/lib/typescript/example/harmony/hvigorfile.d.ts.map +0 -1
- package/lib/typescript/example/index.d.ts +0 -2
- package/lib/typescript/example/index.d.ts.map +0 -1
- package/lib/typescript/example/jest.config.d.ts +0 -3
- package/lib/typescript/example/jest.config.d.ts.map +0 -1
- package/lib/typescript/example/metro.config.d.ts +0 -3
- package/lib/typescript/example/metro.config.d.ts.map +0 -1
- package/lib/typescript/example/react-native.config.d.ts +0 -3
- package/lib/typescript/example/react-native.config.d.ts.map +0 -1
- package/lib/typescript/example/scripts/create-build-profile.d.ts +0 -2
- package/lib/typescript/example/scripts/create-build-profile.d.ts.map +0 -1
- package/lib/typescript/example/src/index.d.ts +0 -3
- package/lib/typescript/example/src/index.d.ts.map +0 -1
- package/lib/typescript/src/css/index.d.ts +0 -4
- package/lib/typescript/src/css/index.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts +0 -3
- package/lib/typescript/src/index.d.ts.map +0 -1
|
@@ -1,112 +1,112 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#pragma once
|
|
8
|
-
|
|
9
|
-
#include "SvgNode.h"
|
|
10
|
-
#include "drawing/Brush.h"
|
|
11
|
-
#include "drawing/Pen.h"
|
|
12
|
-
#include <native_drawing/drawing_canvas.h>
|
|
13
|
-
#include <native_drawing/drawing_filter.h>
|
|
14
|
-
|
|
15
|
-
namespace rnoh {
|
|
16
|
-
namespace svg {
|
|
17
|
-
|
|
18
|
-
enum class FilterType {
|
|
19
|
-
BLUR,
|
|
20
|
-
GAUSSIAN_BLUR,
|
|
21
|
-
DROP_SHADOW,
|
|
22
|
-
COLOR_MATRIX,
|
|
23
|
-
FEOFFSET,
|
|
24
|
-
FEFLOOD,
|
|
25
|
-
BLEND,
|
|
26
|
-
COMPOSITE,
|
|
27
|
-
MERGE,
|
|
28
|
-
UNKNOWN
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
struct FilterEffect {
|
|
32
|
-
FilterType filterType = FilterType::UNKNOWN;
|
|
33
|
-
std::vector<float> values;
|
|
34
|
-
std::string type = "";
|
|
35
|
-
std::string in = "SourceGraphic";
|
|
36
|
-
std::string in2 = "";
|
|
37
|
-
std::string result = "";
|
|
38
|
-
|
|
39
|
-
std::string mode = "";
|
|
40
|
-
std::string operator_ = "";
|
|
41
|
-
std::string floodColor = "black";
|
|
42
|
-
float floodOpacity = 1.0f;
|
|
43
|
-
|
|
44
|
-
float dx_ = 0.0f;
|
|
45
|
-
float dy_ = 0.0f;
|
|
46
|
-
float stdDeviationX_ = 0.0f;
|
|
47
|
-
float stdDeviationY_ = 0.0f;
|
|
48
|
-
std::string edgeMode_ = "duplicate";
|
|
49
|
-
std::string k1 = "";
|
|
50
|
-
std::string k2 = "";
|
|
51
|
-
std::string k3 = "";
|
|
52
|
-
std::string k4 = "";
|
|
53
|
-
|
|
54
|
-
FilterEffect() = default;
|
|
55
|
-
FilterEffect(FilterType t, const std::vector<float>& v) : filterType(t), values(v) {}
|
|
56
|
-
FilterEffect(FilterType t, const std::vector<float>& v, const std::string& inputSource, const std::string& inputType, const std::string& resultId)
|
|
57
|
-
: filterType(t), values(v), in(inputSource), type(inputType), result(resultId) {}
|
|
58
|
-
FilterEffect(FilterType t, const std::string& inputSource, const std::string& inputSource2, const std::string& blendMode, const std::string& resultId)
|
|
59
|
-
: filterType(t), in(inputSource), in2(inputSource2), mode(blendMode), result(resultId) {}
|
|
60
|
-
FilterEffect(FilterType t, const std::string& inputSource, const std::string& color, float opacity, const std::string& resultId)
|
|
61
|
-
: filterType(t), in(inputSource), floodColor(color), floodOpacity(opacity), result(resultId) {}
|
|
62
|
-
FilterEffect(FilterType t, const std::string& inputSource, float dx, float dy, const std::string& resultId)
|
|
63
|
-
: filterType(t), in(inputSource), dx_(dx), dy_(dy), result(resultId) {}
|
|
64
|
-
FilterEffect(FilterType t, const std::string& inputSource, const std::string& inputSource2, const std::string& op,
|
|
65
|
-
const std::string& k1_, const std::string& k2_, const std::string& k3_, const std::string& k4_, const std::string& resultId)
|
|
66
|
-
: filterType(t), in(inputSource), in2(inputSource2), operator_(op), k1(k1_), k2(k2_), k3(k3_), k4(k4_), result(resultId) {}
|
|
67
|
-
FilterEffect(FilterType t, const std::string& inputSource, float stdDeviationX, float stdDeviationY, const std::string& edgeMode, const std::string& resultId)
|
|
68
|
-
: filterType(t), in(inputSource), stdDeviationX_(stdDeviationX), stdDeviationY_(stdDeviationY), edgeMode_(edgeMode), result(resultId) {}
|
|
69
|
-
|
|
70
|
-
// DropShadow specific constructor
|
|
71
|
-
FilterEffect(FilterType t, const std::string& inputSource, float dx, float dy, float stdDeviation, const std::string& color, float opacity)
|
|
72
|
-
: filterType(t), in(inputSource), dx_(dx), dy_(dy), stdDeviationX_(stdDeviation), floodColor(color), floodOpacity(opacity) {}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
class SvgFilter : virtual public SvgNode {
|
|
76
|
-
public:
|
|
77
|
-
SvgFilter() : SvgNode() {}
|
|
78
|
-
~SvgFilter() noexcept override = default;
|
|
79
|
-
void ApplyToBrush(rnoh::drawing::Brush& brush, const std::string& extra = "");
|
|
80
|
-
void ApplyToPen(rnoh::drawing::Pen& pen);
|
|
81
|
-
|
|
82
|
-
void AddFilterEffect(const FilterEffect& effect);
|
|
83
|
-
void ClearFilterEffects() {
|
|
84
|
-
effects_.clear();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
void Draw(OH_Drawing_Canvas *canvas) override {}
|
|
88
|
-
private:
|
|
89
|
-
std::vector<FilterEffect> effects_;
|
|
90
|
-
void ApplySingleEffectToFilter(OH_Drawing_Filter* filter, const FilterEffect& effect,
|
|
91
|
-
rnoh::drawing::Brush* brush = nullptr, rnoh::drawing::Pen* pen = nullptr, const std::string& extra = "");
|
|
92
|
-
|
|
93
|
-
OH_Drawing_ImageFilter* CreateGaussianBlurFilter(const FilterEffect& effect);
|
|
94
|
-
OH_Drawing_MaskFilter* CreateBlurFilter(const FilterEffect& effect);
|
|
95
|
-
OH_Drawing_ColorFilter* CreateColorMatrixFilter(const FilterEffect& effect);
|
|
96
|
-
OH_Drawing_ShadowLayer* CreateDropShadowFilter(const FilterEffect& effect);
|
|
97
|
-
|
|
98
|
-
OH_Drawing_ColorFilter* CreateMatrixFilter(const std::vector<float>& values);
|
|
99
|
-
OH_Drawing_ColorFilter* CreateSaturateFilter(const std::vector<float>& values);
|
|
100
|
-
OH_Drawing_ColorFilter* CreateHueRotateFilter(const std::vector<float>& values);
|
|
101
|
-
OH_Drawing_ColorFilter* CreateLuminanceToAlphaFilter();
|
|
102
|
-
|
|
103
|
-
OH_Drawing_ImageFilter* GetInputImageFilter(const std::string& inputName);
|
|
104
|
-
OH_Drawing_ColorFilter* GetInputColorFilter(const std::string& inputName);
|
|
105
|
-
OH_Drawing_Filter* GetInputFilter(const std::string& inputName);
|
|
106
|
-
OH_Drawing_ColorFilter* CombineWithInputColor(OH_Drawing_ColorFilter* newFilter, const std::string& inputName);
|
|
107
|
-
void RegisterFilterResult(const std::string& resultId, OH_Drawing_ImageFilter* imageFilter = nullptr,
|
|
108
|
-
OH_Drawing_ColorFilter* colorFilter = nullptr, OH_Drawing_MaskFilter* maskFilter = nullptr);
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
} // namespace svg
|
|
112
|
-
} // namespace rnoh
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include "SvgNode.h"
|
|
10
|
+
#include "drawing/Brush.h"
|
|
11
|
+
#include "drawing/Pen.h"
|
|
12
|
+
#include <native_drawing/drawing_canvas.h>
|
|
13
|
+
#include <native_drawing/drawing_filter.h>
|
|
14
|
+
|
|
15
|
+
namespace rnoh {
|
|
16
|
+
namespace svg {
|
|
17
|
+
|
|
18
|
+
enum class FilterType {
|
|
19
|
+
BLUR,
|
|
20
|
+
GAUSSIAN_BLUR,
|
|
21
|
+
DROP_SHADOW,
|
|
22
|
+
COLOR_MATRIX,
|
|
23
|
+
FEOFFSET,
|
|
24
|
+
FEFLOOD,
|
|
25
|
+
BLEND,
|
|
26
|
+
COMPOSITE,
|
|
27
|
+
MERGE,
|
|
28
|
+
UNKNOWN
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
struct FilterEffect {
|
|
32
|
+
FilterType filterType = FilterType::UNKNOWN;
|
|
33
|
+
std::vector<float> values;
|
|
34
|
+
std::string type = "";
|
|
35
|
+
std::string in = "SourceGraphic";
|
|
36
|
+
std::string in2 = "";
|
|
37
|
+
std::string result = "";
|
|
38
|
+
|
|
39
|
+
std::string mode = "";
|
|
40
|
+
std::string operator_ = "";
|
|
41
|
+
std::string floodColor = "black";
|
|
42
|
+
float floodOpacity = 1.0f;
|
|
43
|
+
|
|
44
|
+
float dx_ = 0.0f;
|
|
45
|
+
float dy_ = 0.0f;
|
|
46
|
+
float stdDeviationX_ = 0.0f;
|
|
47
|
+
float stdDeviationY_ = 0.0f;
|
|
48
|
+
std::string edgeMode_ = "duplicate";
|
|
49
|
+
std::string k1 = "";
|
|
50
|
+
std::string k2 = "";
|
|
51
|
+
std::string k3 = "";
|
|
52
|
+
std::string k4 = "";
|
|
53
|
+
|
|
54
|
+
FilterEffect() = default;
|
|
55
|
+
FilterEffect(FilterType t, const std::vector<float>& v) : filterType(t), values(v) {}
|
|
56
|
+
FilterEffect(FilterType t, const std::vector<float>& v, const std::string& inputSource, const std::string& inputType, const std::string& resultId)
|
|
57
|
+
: filterType(t), values(v), in(inputSource), type(inputType), result(resultId) {}
|
|
58
|
+
FilterEffect(FilterType t, const std::string& inputSource, const std::string& inputSource2, const std::string& blendMode, const std::string& resultId)
|
|
59
|
+
: filterType(t), in(inputSource), in2(inputSource2), mode(blendMode), result(resultId) {}
|
|
60
|
+
FilterEffect(FilterType t, const std::string& inputSource, const std::string& color, float opacity, const std::string& resultId)
|
|
61
|
+
: filterType(t), in(inputSource), floodColor(color), floodOpacity(opacity), result(resultId) {}
|
|
62
|
+
FilterEffect(FilterType t, const std::string& inputSource, float dx, float dy, const std::string& resultId)
|
|
63
|
+
: filterType(t), in(inputSource), dx_(dx), dy_(dy), result(resultId) {}
|
|
64
|
+
FilterEffect(FilterType t, const std::string& inputSource, const std::string& inputSource2, const std::string& op,
|
|
65
|
+
const std::string& k1_, const std::string& k2_, const std::string& k3_, const std::string& k4_, const std::string& resultId)
|
|
66
|
+
: filterType(t), in(inputSource), in2(inputSource2), operator_(op), k1(k1_), k2(k2_), k3(k3_), k4(k4_), result(resultId) {}
|
|
67
|
+
FilterEffect(FilterType t, const std::string& inputSource, float stdDeviationX, float stdDeviationY, const std::string& edgeMode, const std::string& resultId)
|
|
68
|
+
: filterType(t), in(inputSource), stdDeviationX_(stdDeviationX), stdDeviationY_(stdDeviationY), edgeMode_(edgeMode), result(resultId) {}
|
|
69
|
+
|
|
70
|
+
// DropShadow specific constructor
|
|
71
|
+
FilterEffect(FilterType t, const std::string& inputSource, float dx, float dy, float stdDeviation, const std::string& color, float opacity)
|
|
72
|
+
: filterType(t), in(inputSource), dx_(dx), dy_(dy), stdDeviationX_(stdDeviation), floodColor(color), floodOpacity(opacity) {}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
class SvgFilter : virtual public SvgNode {
|
|
76
|
+
public:
|
|
77
|
+
SvgFilter() : SvgNode() {}
|
|
78
|
+
~SvgFilter() noexcept override = default;
|
|
79
|
+
void ApplyToBrush(rnoh::drawing::Brush& brush, const std::string& extra = "");
|
|
80
|
+
void ApplyToPen(rnoh::drawing::Pen& pen);
|
|
81
|
+
|
|
82
|
+
void AddFilterEffect(const FilterEffect& effect);
|
|
83
|
+
void ClearFilterEffects() {
|
|
84
|
+
effects_.clear();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
void Draw(OH_Drawing_Canvas *canvas) override {}
|
|
88
|
+
private:
|
|
89
|
+
std::vector<FilterEffect> effects_;
|
|
90
|
+
void ApplySingleEffectToFilter(OH_Drawing_Filter* filter, const FilterEffect& effect,
|
|
91
|
+
rnoh::drawing::Brush* brush = nullptr, rnoh::drawing::Pen* pen = nullptr, const std::string& extra = "");
|
|
92
|
+
|
|
93
|
+
OH_Drawing_ImageFilter* CreateGaussianBlurFilter(const FilterEffect& effect);
|
|
94
|
+
OH_Drawing_MaskFilter* CreateBlurFilter(const FilterEffect& effect);
|
|
95
|
+
OH_Drawing_ColorFilter* CreateColorMatrixFilter(const FilterEffect& effect);
|
|
96
|
+
OH_Drawing_ShadowLayer* CreateDropShadowFilter(const FilterEffect& effect);
|
|
97
|
+
|
|
98
|
+
OH_Drawing_ColorFilter* CreateMatrixFilter(const std::vector<float>& values);
|
|
99
|
+
OH_Drawing_ColorFilter* CreateSaturateFilter(const std::vector<float>& values);
|
|
100
|
+
OH_Drawing_ColorFilter* CreateHueRotateFilter(const std::vector<float>& values);
|
|
101
|
+
OH_Drawing_ColorFilter* CreateLuminanceToAlphaFilter();
|
|
102
|
+
|
|
103
|
+
OH_Drawing_ImageFilter* GetInputImageFilter(const std::string& inputName);
|
|
104
|
+
OH_Drawing_ColorFilter* GetInputColorFilter(const std::string& inputName);
|
|
105
|
+
OH_Drawing_Filter* GetInputFilter(const std::string& inputName);
|
|
106
|
+
OH_Drawing_ColorFilter* CombineWithInputColor(OH_Drawing_ColorFilter* newFilter, const std::string& inputName);
|
|
107
|
+
void RegisterFilterResult(const std::string& resultId, OH_Drawing_ImageFilter* imageFilter = nullptr,
|
|
108
|
+
OH_Drawing_ColorFilter* colorFilter = nullptr, OH_Drawing_MaskFilter* maskFilter = nullptr);
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
} // namespace svg
|
|
112
|
+
} // namespace rnoh
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#include "RNSVGFeBlendComponentInstance.h"
|
|
8
|
-
#include "utils/DynamicUtils.h"
|
|
9
|
-
#include <glog/logging.h>
|
|
10
|
-
|
|
11
|
-
namespace facebook::react {
|
|
12
|
-
// Forward declaration for toString function
|
|
13
|
-
static inline std::string toString(const RNSVGFeBlendMode &value);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
namespace rnoh {
|
|
17
|
-
namespace svg {
|
|
18
|
-
|
|
19
|
-
RNSVGFeBlendComponentInstance::RNSVGFeBlendComponentInstance(Context context)
|
|
20
|
-
: RNSVGBaseComponentInstance(std::move(context)) {}
|
|
21
|
-
|
|
22
|
-
void RNSVGFeBlendComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
23
|
-
if (props) {
|
|
24
|
-
x_ = DynamicUtils::DynamicToString(props->x);
|
|
25
|
-
y_ = DynamicUtils::DynamicToString(props->y);
|
|
26
|
-
width_ = DynamicUtils::DynamicToString(props->width);
|
|
27
|
-
height_ = DynamicUtils::DynamicToString(props->height);
|
|
28
|
-
in_ = props->in1;
|
|
29
|
-
in2_ = props->in2;
|
|
30
|
-
mode_ = facebook::react::toString(props->mode);
|
|
31
|
-
result_ = props->result;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
void RNSVGFeBlendComponentInstance::UpdateElementProps() {}
|
|
36
|
-
|
|
37
|
-
void RNSVGFeBlendComponentInstance::extractAttributes() {}
|
|
38
|
-
|
|
39
|
-
} // namespace svg
|
|
40
|
-
} // namespace rnoh
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#include "RNSVGFeBlendComponentInstance.h"
|
|
8
|
+
#include "utils/DynamicUtils.h"
|
|
9
|
+
#include <glog/logging.h>
|
|
10
|
+
|
|
11
|
+
namespace facebook::react {
|
|
12
|
+
// Forward declaration for toString function
|
|
13
|
+
static inline std::string toString(const RNSVGFeBlendMode &value);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
namespace rnoh {
|
|
17
|
+
namespace svg {
|
|
18
|
+
|
|
19
|
+
RNSVGFeBlendComponentInstance::RNSVGFeBlendComponentInstance(Context context)
|
|
20
|
+
: RNSVGBaseComponentInstance(std::move(context)) {}
|
|
21
|
+
|
|
22
|
+
void RNSVGFeBlendComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
23
|
+
if (props) {
|
|
24
|
+
x_ = DynamicUtils::DynamicToString(props->x);
|
|
25
|
+
y_ = DynamicUtils::DynamicToString(props->y);
|
|
26
|
+
width_ = DynamicUtils::DynamicToString(props->width);
|
|
27
|
+
height_ = DynamicUtils::DynamicToString(props->height);
|
|
28
|
+
in_ = props->in1;
|
|
29
|
+
in2_ = props->in2;
|
|
30
|
+
mode_ = facebook::react::toString(props->mode);
|
|
31
|
+
result_ = props->result;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
void RNSVGFeBlendComponentInstance::UpdateElementProps() {}
|
|
36
|
+
|
|
37
|
+
void RNSVGFeBlendComponentInstance::extractAttributes() {}
|
|
38
|
+
|
|
39
|
+
} // namespace svg
|
|
40
|
+
} // namespace rnoh
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#pragma once
|
|
8
|
-
|
|
9
|
-
#include "RNSVGBaseComponentInstance.h"
|
|
10
|
-
#include <react/renderer/components/react_native_svg/ShadowNodes.h>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
namespace rnoh {
|
|
14
|
-
namespace svg {
|
|
15
|
-
|
|
16
|
-
class RNSVGFeBlendComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeBlendShadowNode> {
|
|
17
|
-
public:
|
|
18
|
-
using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeBlendProps>;
|
|
19
|
-
|
|
20
|
-
RNSVGFeBlendComponentInstance(Context context);
|
|
21
|
-
|
|
22
|
-
void onPropsChanged(SharedConcreteProps const &props) override;
|
|
23
|
-
void UpdateElementProps() override;
|
|
24
|
-
|
|
25
|
-
std::string getIn() const { return in_; }
|
|
26
|
-
std::string getIn2() const { return in2_; }
|
|
27
|
-
std::string getMode() const { return mode_; }
|
|
28
|
-
std::string getResult() const { return result_; }
|
|
29
|
-
std::string getX() const { return x_; }
|
|
30
|
-
std::string getY() const { return y_; }
|
|
31
|
-
std::string getWidth() const { return width_; }
|
|
32
|
-
std::string getHeight() const { return height_; }
|
|
33
|
-
|
|
34
|
-
private:
|
|
35
|
-
std::string x_ = "0";
|
|
36
|
-
std::string y_ = "0";
|
|
37
|
-
std::string width_ = "0";
|
|
38
|
-
std::string height_ = "0";
|
|
39
|
-
std::string in_ = "SourceGraphic";
|
|
40
|
-
std::string in2_ = "";
|
|
41
|
-
std::string mode_ = "normal";
|
|
42
|
-
std::string result_ = "";
|
|
43
|
-
|
|
44
|
-
void extractAttributes();
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
} // namespace svg
|
|
48
|
-
} // namespace rnoh
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include "RNSVGBaseComponentInstance.h"
|
|
10
|
+
#include <react/renderer/components/react_native_svg/ShadowNodes.h>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
namespace rnoh {
|
|
14
|
+
namespace svg {
|
|
15
|
+
|
|
16
|
+
class RNSVGFeBlendComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeBlendShadowNode> {
|
|
17
|
+
public:
|
|
18
|
+
using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeBlendProps>;
|
|
19
|
+
|
|
20
|
+
RNSVGFeBlendComponentInstance(Context context);
|
|
21
|
+
|
|
22
|
+
void onPropsChanged(SharedConcreteProps const &props) override;
|
|
23
|
+
void UpdateElementProps() override;
|
|
24
|
+
|
|
25
|
+
std::string getIn() const { return in_; }
|
|
26
|
+
std::string getIn2() const { return in2_; }
|
|
27
|
+
std::string getMode() const { return mode_; }
|
|
28
|
+
std::string getResult() const { return result_; }
|
|
29
|
+
std::string getX() const { return x_; }
|
|
30
|
+
std::string getY() const { return y_; }
|
|
31
|
+
std::string getWidth() const { return width_; }
|
|
32
|
+
std::string getHeight() const { return height_; }
|
|
33
|
+
|
|
34
|
+
private:
|
|
35
|
+
std::string x_ = "0";
|
|
36
|
+
std::string y_ = "0";
|
|
37
|
+
std::string width_ = "0";
|
|
38
|
+
std::string height_ = "0";
|
|
39
|
+
std::string in_ = "SourceGraphic";
|
|
40
|
+
std::string in2_ = "";
|
|
41
|
+
std::string mode_ = "normal";
|
|
42
|
+
std::string result_ = "";
|
|
43
|
+
|
|
44
|
+
void extractAttributes();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
} // namespace svg
|
|
48
|
+
} // namespace rnoh
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#include "RNSVGFeColorMatrixComponentInstance.h"
|
|
8
|
-
#include "utils/DynamicUtils.h"
|
|
9
|
-
#include <glog/logging.h>
|
|
10
|
-
|
|
11
|
-
namespace rnoh {
|
|
12
|
-
namespace svg {
|
|
13
|
-
|
|
14
|
-
RNSVGFeColorMatrixComponentInstance::RNSVGFeColorMatrixComponentInstance(Context context)
|
|
15
|
-
: RNSVGBaseComponentInstance(std::move(context)) {}
|
|
16
|
-
|
|
17
|
-
void RNSVGFeColorMatrixComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
18
|
-
if (props) {
|
|
19
|
-
type_ = facebook::react::toString(props->type);
|
|
20
|
-
in_ = props->in1;
|
|
21
|
-
values_ = std::vector<float>(props->values.begin(), props->values.end());
|
|
22
|
-
x_ = DynamicUtils::DynamicToString(props->x);
|
|
23
|
-
y_ = DynamicUtils::DynamicToString(props->y);
|
|
24
|
-
width_ = DynamicUtils::DynamicToString(props->width);
|
|
25
|
-
height_ = DynamicUtils::DynamicToString(props->height);
|
|
26
|
-
result_ = props->result;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
void RNSVGFeColorMatrixComponentInstance::UpdateElementProps() {}
|
|
31
|
-
|
|
32
|
-
} // namespace svg
|
|
33
|
-
} // namespace rnoh
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#include "RNSVGFeColorMatrixComponentInstance.h"
|
|
8
|
+
#include "utils/DynamicUtils.h"
|
|
9
|
+
#include <glog/logging.h>
|
|
10
|
+
|
|
11
|
+
namespace rnoh {
|
|
12
|
+
namespace svg {
|
|
13
|
+
|
|
14
|
+
RNSVGFeColorMatrixComponentInstance::RNSVGFeColorMatrixComponentInstance(Context context)
|
|
15
|
+
: RNSVGBaseComponentInstance(std::move(context)) {}
|
|
16
|
+
|
|
17
|
+
void RNSVGFeColorMatrixComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
18
|
+
if (props) {
|
|
19
|
+
type_ = facebook::react::toString(props->type);
|
|
20
|
+
in_ = props->in1;
|
|
21
|
+
values_ = std::vector<float>(props->values.begin(), props->values.end());
|
|
22
|
+
x_ = DynamicUtils::DynamicToString(props->x);
|
|
23
|
+
y_ = DynamicUtils::DynamicToString(props->y);
|
|
24
|
+
width_ = DynamicUtils::DynamicToString(props->width);
|
|
25
|
+
height_ = DynamicUtils::DynamicToString(props->height);
|
|
26
|
+
result_ = props->result;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
void RNSVGFeColorMatrixComponentInstance::UpdateElementProps() {}
|
|
31
|
+
|
|
32
|
+
} // namespace svg
|
|
33
|
+
} // namespace rnoh
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#pragma once
|
|
8
|
-
|
|
9
|
-
#include "RNSVGBaseComponentInstance.h"
|
|
10
|
-
#include <react/renderer/components/react_native_svg/ShadowNodes.h>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
namespace rnoh {
|
|
14
|
-
namespace svg {
|
|
15
|
-
|
|
16
|
-
class RNSVGFeColorMatrixComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeColorMatrixShadowNode> {
|
|
17
|
-
public:
|
|
18
|
-
using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeColorMatrixProps>;
|
|
19
|
-
|
|
20
|
-
RNSVGFeColorMatrixComponentInstance(Context context);
|
|
21
|
-
|
|
22
|
-
void onPropsChanged(SharedConcreteProps const &props) override;
|
|
23
|
-
void UpdateElementProps() override;
|
|
24
|
-
|
|
25
|
-
std::string getX() const { return x_; }
|
|
26
|
-
std::string getY() const { return y_; }
|
|
27
|
-
std::string getWidth() const { return width_; }
|
|
28
|
-
std::string getHeight() const { return height_; }
|
|
29
|
-
std::string getResult() const { return result_; }
|
|
30
|
-
std::string getType() const { return type_; }
|
|
31
|
-
std::string getIn() const { return in_; }
|
|
32
|
-
std::vector<float> getValues() const { return values_; }
|
|
33
|
-
|
|
34
|
-
private:
|
|
35
|
-
std::string x_ = "0";
|
|
36
|
-
std::string y_ = "0";
|
|
37
|
-
std::string width_ = "0";
|
|
38
|
-
std::string height_ = "0";
|
|
39
|
-
std::string result_ = "";
|
|
40
|
-
std::string type_ = "saturate";
|
|
41
|
-
std::string in_ = "SourceGraphic";
|
|
42
|
-
std::vector<float> values_ = {1.0f};
|
|
43
|
-
|
|
44
|
-
void extractAttributes();
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
} // namespace svg
|
|
48
|
-
} // namespace rnoh
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#pragma once
|
|
8
|
+
|
|
9
|
+
#include "RNSVGBaseComponentInstance.h"
|
|
10
|
+
#include <react/renderer/components/react_native_svg/ShadowNodes.h>
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
namespace rnoh {
|
|
14
|
+
namespace svg {
|
|
15
|
+
|
|
16
|
+
class RNSVGFeColorMatrixComponentInstance : public RNSVGBaseComponentInstance<facebook::react::RNSVGFeColorMatrixShadowNode> {
|
|
17
|
+
public:
|
|
18
|
+
using SharedConcreteProps = std::shared_ptr<const facebook::react::RNSVGFeColorMatrixProps>;
|
|
19
|
+
|
|
20
|
+
RNSVGFeColorMatrixComponentInstance(Context context);
|
|
21
|
+
|
|
22
|
+
void onPropsChanged(SharedConcreteProps const &props) override;
|
|
23
|
+
void UpdateElementProps() override;
|
|
24
|
+
|
|
25
|
+
std::string getX() const { return x_; }
|
|
26
|
+
std::string getY() const { return y_; }
|
|
27
|
+
std::string getWidth() const { return width_; }
|
|
28
|
+
std::string getHeight() const { return height_; }
|
|
29
|
+
std::string getResult() const { return result_; }
|
|
30
|
+
std::string getType() const { return type_; }
|
|
31
|
+
std::string getIn() const { return in_; }
|
|
32
|
+
std::vector<float> getValues() const { return values_; }
|
|
33
|
+
|
|
34
|
+
private:
|
|
35
|
+
std::string x_ = "0";
|
|
36
|
+
std::string y_ = "0";
|
|
37
|
+
std::string width_ = "0";
|
|
38
|
+
std::string height_ = "0";
|
|
39
|
+
std::string result_ = "";
|
|
40
|
+
std::string type_ = "saturate";
|
|
41
|
+
std::string in_ = "SourceGraphic";
|
|
42
|
+
std::vector<float> values_ = {1.0f};
|
|
43
|
+
|
|
44
|
+
void extractAttributes();
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
} // namespace svg
|
|
48
|
+
} // namespace rnoh
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
#include "RNSVGFeCompositeComponentInstance.h"
|
|
8
|
-
#include "utils/DynamicUtils.h"
|
|
9
|
-
#include <glog/logging.h>
|
|
10
|
-
|
|
11
|
-
namespace rnoh {
|
|
12
|
-
namespace svg {
|
|
13
|
-
|
|
14
|
-
RNSVGFeCompositeComponentInstance::RNSVGFeCompositeComponentInstance(Context context)
|
|
15
|
-
: RNSVGBaseComponentInstance(std::move(context)) {}
|
|
16
|
-
|
|
17
|
-
void RNSVGFeCompositeComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
18
|
-
if (props) {
|
|
19
|
-
x_ = DynamicUtils::DynamicToString(props->x);
|
|
20
|
-
y_ = DynamicUtils::DynamicToString(props->y);
|
|
21
|
-
width_ = DynamicUtils::DynamicToString(props->width);
|
|
22
|
-
height_ = DynamicUtils::DynamicToString(props->height);
|
|
23
|
-
in_ = props->in1;
|
|
24
|
-
in2_ = props->in2;
|
|
25
|
-
operator_ = facebook::react::toString(props->operator1);
|
|
26
|
-
result_ = props->result;
|
|
27
|
-
k1_ = std::to_string(props->k1);
|
|
28
|
-
k2_ = std::to_string(props->k2);
|
|
29
|
-
k3_ = std::to_string(props->k3);
|
|
30
|
-
k4_ = std::to_string(props->k4);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
void RNSVGFeCompositeComponentInstance::UpdateElementProps() {}
|
|
35
|
-
|
|
36
|
-
void RNSVGFeCompositeComponentInstance::extractAttributes() {}
|
|
37
|
-
|
|
38
|
-
} // namespace svg
|
|
39
|
-
} // namespace rnoh
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
#include "RNSVGFeCompositeComponentInstance.h"
|
|
8
|
+
#include "utils/DynamicUtils.h"
|
|
9
|
+
#include <glog/logging.h>
|
|
10
|
+
|
|
11
|
+
namespace rnoh {
|
|
12
|
+
namespace svg {
|
|
13
|
+
|
|
14
|
+
RNSVGFeCompositeComponentInstance::RNSVGFeCompositeComponentInstance(Context context)
|
|
15
|
+
: RNSVGBaseComponentInstance(std::move(context)) {}
|
|
16
|
+
|
|
17
|
+
void RNSVGFeCompositeComponentInstance::onPropsChanged(SharedConcreteProps const &props) {
|
|
18
|
+
if (props) {
|
|
19
|
+
x_ = DynamicUtils::DynamicToString(props->x);
|
|
20
|
+
y_ = DynamicUtils::DynamicToString(props->y);
|
|
21
|
+
width_ = DynamicUtils::DynamicToString(props->width);
|
|
22
|
+
height_ = DynamicUtils::DynamicToString(props->height);
|
|
23
|
+
in_ = props->in1;
|
|
24
|
+
in2_ = props->in2;
|
|
25
|
+
operator_ = facebook::react::toString(props->operator1);
|
|
26
|
+
result_ = props->result;
|
|
27
|
+
k1_ = std::to_string(props->k1);
|
|
28
|
+
k2_ = std::to_string(props->k2);
|
|
29
|
+
k3_ = std::to_string(props->k3);
|
|
30
|
+
k4_ = std::to_string(props->k4);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
void RNSVGFeCompositeComponentInstance::UpdateElementProps() {}
|
|
35
|
+
|
|
36
|
+
void RNSVGFeCompositeComponentInstance::extractAttributes() {}
|
|
37
|
+
|
|
38
|
+
} // namespace svg
|
|
39
|
+
} // namespace rnoh
|