Reads a DWORD (32 bits) using in little-endian byte ordering.
| 307 | |
| 308 | // Reads a DWORD (32 bits) using in little-endian byte ordering. |
| 309 | uint32_t Decoder::read32() |
| 310 | { |
| 311 | const uint8_t b1 = m_file->read8(); |
| 312 | const uint8_t b2 = m_file->read8(); |
| 313 | const uint8_t b3 = m_file->read8(); |
| 314 | const uint8_t b4 = m_file->read8(); |
| 315 | |
| 316 | if (m_file->ok()) { |
| 317 | // Little endian |
| 318 | return ((b4 << 24) | (b3 << 16) | (b2 << 8) | b1); |
| 319 | } |
| 320 | else |
| 321 | return 0; |
| 322 | } |
| 323 | |
| 324 | color_t Decoder::read32AsRgb() |
| 325 | { |