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