| 214 | } |
| 215 | |
| 216 | color_t read16AsRgb(std::ifstream &file, bool hasAlpha) |
| 217 | { |
| 218 | const auto v = read16(file); |
| 219 | uint8_t a = 255; |
| 220 | if (hasAlpha) |
| 221 | { |
| 222 | if ((v & 0x8000) == 0) // Transparent bit |
| 223 | a = 0; |
| 224 | } |
| 225 | return rgba(scale_5bits_to_8bits((v >> 10) & 0x1F), |
| 226 | scale_5bits_to_8bits((v >> 5) & 0x1F), |
| 227 | scale_5bits_to_8bits(v & 0x1F), |
| 228 | a); |
| 229 | } |
| 230 | |
| 231 | color_t read24AsRgb(std::ifstream &file) |
| 232 | { |
no test coverage detected