Skip to content

Commit 294ac29

Browse files
committed
Separating the implementation
xbrushes.h implementation -> xio2d_impl.h
1 parent 201ab33 commit 294ac29

File tree

2 files changed

+41
-28
lines changed

2 files changed

+41
-28
lines changed

N3888_RefImpl/src/xbrushes.h

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,34 +30,18 @@ namespace std::experimental::io2d {
3030
float _Offset;
3131
rgba_color _Color;
3232
public:
33-
constexpr gradient_stop() noexcept
34-
: _Offset(0.0F)
35-
, _Color(rgba_color{}) {}
36-
constexpr gradient_stop(float offset, const rgba_color& color)
37-
: _Offset(offset)
38-
, _Color(color) {}
39-
40-
constexpr void offset(float value) noexcept {
41-
_Offset = value;
42-
}
43-
constexpr void color(const rgba_color& value) noexcept {
44-
_Color = value;
45-
}
46-
47-
constexpr float offset() const noexcept {
48-
return _Offset;
49-
}
50-
constexpr rgba_color color() const noexcept {
51-
return _Color;
52-
}
53-
54-
constexpr bool operator==(const gradient_stop& rhs) {
55-
return _Offset == rhs._Offset && _Color == rhs._Color;
56-
}
57-
58-
constexpr bool operator!=(const gradient_stop& rhs) {
59-
return !((*this) == rhs);
60-
}
33+
constexpr gradient_stop() noexcept;
34+
constexpr gradient_stop(float offset, const rgba_color& color);
35+
36+
constexpr void offset(float value) noexcept;
37+
constexpr void color(const rgba_color& value) noexcept;
38+
39+
constexpr float offset() const noexcept;
40+
constexpr rgba_color color() const noexcept;
41+
42+
constexpr bool operator==(const gradient_stop& rhs);
43+
44+
constexpr bool operator!=(const gradient_stop& rhs);
6145
};
6246

6347
constexpr bool operator==(const gradient_stop& lhs, const gradient_stop& rhs)

N3888_RefImpl/src/xio2d_impl.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,6 +2108,35 @@ namespace std::experimental::io2d {
21082108

21092109
//Brushes
21102110

2111+
inline constexpr gradient_stop::gradient_stop() noexcept
2112+
: _Offset(0.0F)
2113+
, _Color(rgba_color{}) {}
2114+
inline constexpr gradient_stop::gradient_stop(float offset, const rgba_color& color)
2115+
: _Offset(offset)
2116+
, _Color(color) {}
2117+
2118+
inline constexpr void gradient_stop::offset(float value) noexcept {
2119+
_Offset = value;
2120+
}
2121+
inline constexpr void gradient_stop::color(const rgba_color& value) noexcept {
2122+
_Color = value;
2123+
}
2124+
2125+
inline constexpr float gradient_stop::offset() const noexcept {
2126+
return _Offset;
2127+
}
2128+
inline constexpr rgba_color gradient_stop::color() const noexcept {
2129+
return _Color;
2130+
}
2131+
2132+
inline constexpr bool gradient_stop::operator==(const gradient_stop& rhs) {
2133+
return _Offset == rhs._Offset && _Color == rhs._Color;
2134+
}
2135+
2136+
inline constexpr bool gradient_stop::operator!=(const gradient_stop& rhs) {
2137+
return !((*this) == rhs);
2138+
}
2139+
21112140
template <class InputIterator>
21122141
inline brush::brush(const point_2d& begin, const point_2d& end,
21132142
InputIterator first, InputIterator last)

0 commit comments

Comments
 (0)