6 #include "internal/Pixel.h"
14 template <
typename NumberT>
19 constexpr
LABPixel(NumberT l = 0, NumberT a = 0, NumberT b = 0) : l(l), a(a), b(b) {
23 [[nodiscard]]
inline bool operator==(
const LABPixel &other)
const {
24 return l == other.l && a == other.a && b == other.b;
26 [[nodiscard]]
inline bool operator!=(
const LABPixel &other)
const {
27 return !(*
this == other);
31 inline void setGray(NumberT new_luma) {
38 static_cast<float>(a.b)};
40 static_cast<float>(b.b)};
41 return std::sqrt((a.l - b.l) * (a.l - b.l) + (a.a - b.a) * (a.a - b.a) +
42 (a.b - b.b) * (a.b - b.b));
45 } __attribute__((packed));