| 78 | }; |
| 79 | |
| 80 | class Colormap |
| 81 | { |
| 82 | public: |
| 83 | Colormap() = default; |
| 84 | Colormap(const int n) : m_color(n) {} |
| 85 | |
| 86 | int size() const { return int(m_color.size()); } |
| 87 | |
| 88 | const color_t &operator[](int i) const { return m_color[i]; } |
| 89 | |
| 90 | color_t &operator[](int i) { return m_color[i]; } |
| 91 | |
| 92 | bool operator==(const Colormap &o) const |
| 93 | { |
| 94 | for (int i = 0; i < int(m_color.size()); ++i) |
| 95 | { |
| 96 | if (m_color[i] != o[i]) |
| 97 | return false; |
| 98 | } |
| 99 | return true; |
| 100 | } |
| 101 | |
| 102 | bool operator!=(const Colormap &o) const { return !operator==(o); } |
| 103 | |
| 104 | private: |
| 105 | std::vector<color_t> m_color; |
| 106 | }; |
| 107 | |
| 108 | struct Header |
| 109 | { |