1 |
|
|
#include "PatternLineN.hpp" |
2 |
|
|
|
3 |
|
|
namespace blink1_lib { |
4 |
|
1 |
PatternLineN::PatternLineN(const RGBN& _rgbn, const std::uint16_t _fadeMillis) noexcept : fadeMillis(_fadeMillis), rgbn(_rgbn) {} |
5 |
|
16 |
PatternLineN::PatternLineN(const std::uint8_t _r, const std::uint8_t _g, const std::uint8_t _b, const std::uint8_t _n, const std::uint16_t _fadeMillis) noexcept |
6 |
|
16 |
: fadeMillis(_fadeMillis), rgbn(_r, _g, _b, _n) {} |
7 |
|
|
|
8 |
|
6 |
bool PatternLineN::operator==(const PatternLineN& other) const noexcept { |
9 |
✓✓✓✓
|
6 |
return fadeMillis == other.fadeMillis && rgbn == other.rgbn; |
10 |
|
|
} |
11 |
|
|
|
12 |
|
5 |
bool PatternLineN::operator!=(const PatternLineN& other) const noexcept { |
13 |
|
5 |
return !(*this == other); |
14 |
|
|
} |
15 |
|
|
|
16 |
|
1 |
std::ostream& operator<<(std::ostream& os, const PatternLineN& patternLine) { |
17 |
|
1 |
os << "PatternLine{rgbn=" << patternLine.rgbn << ", fadeMillis=" << static_cast<unsigned>(patternLine.fadeMillis) << "}"; |
18 |
|
1 |
return os; |
19 |
|
|
} |
20 |
|
|
} |