Img2Num C++ (Internal Developer Docs)  dev
API Documentation
LABAPixel.h
1 #ifndef LABAPixel_H
2 #define LABAPixel_H
3 
4 #include "internal/LABPixel.h"
5 
6 namespace ImageLib {
7 template <typename NumberT>
8 struct LABAPixel : public ImageLib::LABPixel<NumberT> {
9  // ----- Members -----
10  NumberT alpha;
11 
12  // ----- Constructors -----
13  constexpr LABAPixel(NumberT l = 0, NumberT a = 0, NumberT b = 0, NumberT alpha = 255)
14  : LABPixel<NumberT>(l, a, b), alpha(alpha) {
15  }
16 
17  // ----- Modifiers -----
18  [[nodiscard]] inline bool operator==(const LABAPixel &other) const {
19  return LABPixel<NumberT>::operator==(other) && alpha == other.alpha;
20  }
21  [[nodiscard]] inline bool operator!=(const LABAPixel &other) const {
22  return !(*this == other);
23  }
24 
25  // ----- Utilities -----
26  inline void setGray(NumberT gray, NumberT alpha = 255) {
28  this->alpha = alpha;
29  }
30 
31 } __attribute__((packed));
32 } // namespace ImageLib
33 
34 #endif // LABAPixel_H