| 195 | } |
| 196 | |
| 197 | std::optional<View> getForColour(ExtColour paletteId) |
| 198 | { |
| 199 | auto g1Index = getPaletteG1Index(paletteId); |
| 200 | if (g1Index) |
| 201 | { |
| 202 | auto g1 = getG1Element(*g1Index); |
| 203 | if (g1 != nullptr) |
| 204 | { |
| 205 | const size_t length = g1->width * g1->height; |
| 206 | |
| 207 | // Palette maps must be of 256 entries per row. |
| 208 | assert((length % kDefaultSize) == 0); |
| 209 | |
| 210 | return View(std::span{ g1->offset, length }); |
| 211 | } |
| 212 | } |
| 213 | return std::nullopt; |
| 214 | } |
| 215 | |
| 216 | std::optional<View> getForImage(const ImageId image) |
| 217 | { |
no test coverage detected