Return the format of a channel. * * @param[in] channel Channel type. * * @return Format of the given channel. */
| 162 | * @return Format of the given channel. |
| 163 | */ |
| 164 | inline Format get_channel_format(Channel channel) |
| 165 | { |
| 166 | switch (channel) |
| 167 | { |
| 168 | case Channel::R: |
| 169 | case Channel::G: |
| 170 | case Channel::B: |
| 171 | return Format::U8; |
| 172 | default: |
| 173 | throw std::runtime_error("Unsupported channel"); |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | /** Base case of foldl. |
| 178 | * |