16 NumberT red, green, blue;
18 constexpr RGBPixel(NumberT red = 0, NumberT green = 0, NumberT blue = 0)
25 [[nodiscard]]
inline bool operator==(
const RGBPixel& other)
const {
26 return red == other.red && green == other.green && blue == other.blue;
28 [[nodiscard]]
inline bool operator!=(
const RGBPixel& other)
const {
29 return !(*
this == other);
33 inline void setGray(NumberT gray) {
34 red = green = blue = gray;
39 static_cast<float>(a.red),
static_cast<float>(a.green),
static_cast<float>(a.blue)};
41 static_cast<float>(b.red),
static_cast<float>(b.green),
static_cast<float>(b.blue)};
43 (af.red - bf.red) * (af.red - bf.red) + (af.green - bf.green) * (af.green - bf.green) +
44 (af.blue - bf.blue) * (af.blue - bf.blue)